From 5d1155c08edf7f53eca804b2b6538636c2dfe711 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Fri, 28 Oct 2011 14:45:05 +0200 Subject: Closes #13258: Use callable() built-in in the standard library. --- Lib/pydoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/pydoc.py') diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 1a5db1a66f..d0c6f62148 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -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 -- cgit v1.2.1