]> granicus.if.org Git - python/commitdiff
Extend isclass() to work for extension classes (by looking for __bases__).
authorKa-Ping Yee <ping@zesty.ca>
Fri, 23 Mar 2001 15:29:59 +0000 (15:29 +0000)
committerKa-Ping Yee <ping@zesty.ca>
Fri, 23 Mar 2001 15:29:59 +0000 (15:29 +0000)
Lib/inspect.py

index ef813a61f5e355d315d81dc15518ab2820ce1579..eeb3034f182d7cb908dff798e67d93a8ee0a804c 100644 (file)
@@ -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.