summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-25 11:27:05 +0100
committerGeorg Brandl <georg@python.org>2009-10-25 11:27:05 +0100
commit2df42c5cb319f5cf0dd7f72be78c0b16579cbcac (patch)
tree33995bd8a2977e536d6991d8733c82070b7f5eed /sphinx/ext/autodoc.py
parented53cfc2ceac480e19ed776c5e9038e4918eea04 (diff)
parentf04ca65690f1d1f63965f24b3b9bd4250f13cc33 (diff)
downloadsphinx-git-2df42c5cb319f5cf0dd7f72be78c0b16579cbcac.tar.gz
merge with 0.6
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 705853c20..ef09b61a1 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -971,10 +971,10 @@ class MethodDocumenter(ClassLevelDocumenter):
"""
objtype = 'method'
member_order = 50
+ priority = 0
@classmethod
def can_document_member(cls, member, membername, isattr, parent):
- # other attributes are recognized via the module analyzer
return inspect.isroutine(member) and \
not isinstance(parent, ModuleDocumenter)
@@ -1017,11 +1017,18 @@ class AttributeDocumenter(ClassLevelDocumenter):
objtype = 'attribute'
member_order = 60
+ # must be higher than the MethodDocumenter, else it will recognize
+ # some non-data descriptors as methods
+ priority = 10
+
+ method_types = (FunctionType, BuiltinFunctionType, MethodType)
+
@classmethod
def can_document_member(cls, member, membername, isattr, parent):
- return (isdescriptor(member) and not
- isinstance(member, (FunctionType, BuiltinFunctionType))) \
- or (not isinstance(parent, ModuleDocumenter) and isattr)
+ isdatadesc = isdescriptor(member) and not \
+ isinstance(member, cls.method_types)
+ return isdatadesc or \
+ (isattr and not isinstance(parent, ModuleDocumenter))
def document_members(self, all_members=False):
pass