Closes #13258: Use callable() built-in in the standard library.

This commit is contained in:
Florent Xicluna 2011-10-28 14:45:05 +02:00
parent f99e4b5dbe
commit 5d1155c08e
25 changed files with 48 additions and 51 deletions

View file

@ -775,7 +775,7 @@ class HTMLDoc(Doc):
push(msg)
for name, kind, homecls, value in ok:
base = self.docother(getattr(object, name), name, mod)
if hasattr(value, '__call__') or inspect.isdatadescriptor(value):
if callable(value) or inspect.isdatadescriptor(value):
doc = getattr(value, "__doc__", None)
else:
doc = None
@ -1199,7 +1199,7 @@ location listed above.
hr.maybe()
push(msg)
for name, kind, homecls, value in ok:
if hasattr(value, '__call__') or inspect.isdatadescriptor(value):
if callable(value) or inspect.isdatadescriptor(value):
doc = getdoc(value)
else:
doc = None