replace callable()

This commit is contained in:
Benjamin Peterson 2009-10-09 22:05:45 +00:00
parent 0c8bee6393
commit de0559998f
7 changed files with 18 additions and 18 deletions

View file

@ -570,7 +570,7 @@ def _getmethods(obj, methods):
# Adds names to dictionary argument 'methods'
for name in dir(obj):
attr = getattr(obj, name)
if callable(attr):
if hasattr(attr, '__call__'):
methods[name] = 1
if type(obj) == types.InstanceType:
_getmethods(obj.__class__, methods)
@ -581,7 +581,7 @@ def _getmethods(obj, methods):
def _getattributes(obj, attributes):
for name in dir(obj):
attr = getattr(obj, name)
if not callable(attr):
if not hasattr(attr, '__call__'):
attributes[name] = 1
class MethodProxy(object):