mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Extend isclass() to work for extension classes (by looking for __bases__).
This commit is contained in:
parent
324cc6ee0e
commit
a9c6c8dab5
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue