summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2011-06-25 18:23:22 +0200
committerPauli Virtanen <pav@iki.fi>2011-06-25 18:26:25 +0200
commit7a57dc108fe8ee981439aea38df0d35cfbffaf4c (patch)
tree82fb1ff05d0043bfa6b804aa9575ec2809d00b3b
parent9a287ba152e26ec0c9a1d658a3532f61e9291faa (diff)
downloadnumpy-7a57dc108fe8ee981439aea38df0d35cfbffaf4c.tar.gz
sphinxext: expose __call__ in the documentation, if it is present
-rw-r--r--doc/sphinxext/docscrape.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/sphinxext/docscrape.py b/doc/sphinxext/docscrape.py
index 615ea11f8..bbd3fcacc 100644
--- a/doc/sphinxext/docscrape.py
+++ b/doc/sphinxext/docscrape.py
@@ -460,6 +460,9 @@ class FunctionDoc(NumpyDocString):
class ClassDoc(NumpyDocString):
+
+ extra_public_methods = ['__call__']
+
def __init__(self, cls, doc=None, modulename='', func_doc=FunctionDoc,
config={}):
if not inspect.isclass(cls) and cls is not None:
@@ -490,7 +493,9 @@ class ClassDoc(NumpyDocString):
if self._cls is None:
return []
return [name for name,func in inspect.getmembers(self._cls)
- if not name.startswith('_') and callable(func)]
+ if ((not name.startswith('_')
+ or name in self.extra_public_methods)
+ and callable(func))]
@property
def properties(self):