diff options
author | Georg Brandl <georg@python.org> | 2009-09-17 14:20:46 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-17 14:20:46 +0200 |
commit | 521049d9a8af6ff0466cf9ad543f186b452f77ab (patch) | |
tree | d74709252fae7b2f4315a5b09e881bbaabb5eaa6 /sphinx/ext/autodoc.py | |
parent | 4dd3346b289b162e7565e99d388f81ac69628eec (diff) | |
download | sphinx-git-521049d9a8af6ff0466cf9ad543f186b452f77ab.tar.gz |
autodoc: give attributes a higher priority so that descriptors are not documented as methods.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index a5e90b6f4..012244f1e 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -965,10 +965,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) @@ -1011,6 +1011,10 @@ 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 + @classmethod def can_document_member(cls, member, membername, isattr, parent): return (isdescriptor(member) and not |