From: Ka-Ping Yee Date: Fri, 23 Mar 2001 15:29:59 +0000 (+0000) Subject: Extend isclass() to work for extension classes (by looking for __bases__). X-Git-Tag: v2.1b2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9c6c8dab5c851271ae488e8559e1dd69875c77e;p=python Extend isclass() to work for extension classes (by looking for __bases__). --- diff --git a/Lib/inspect.py b/Lib/inspect.py index ef813a61f5..eeb3034f18 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -44,7 +44,7 @@ def isclass(object): Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" - return type(object) is types.ClassType + return type(object) is types.ClassType or hasattr(object, '__bases__') def ismethod(object): """Return true if the object is an instance method.