summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2011-05-04 17:18:59 +0200
committerJulian Andres Klode <jak@debian.org>2011-05-04 17:18:59 +0200
commit9088433491a488f2e08b22dee3a1ced7b3d4ce51 (patch)
treef89b0d08fd601a778b06446baaa233331960915e /sphinx/ext/autodoc.py
parentb9bd2ff791ce5195668a4ffa8f552bb3b3cb402d (diff)
downloadsphinx-git-9088433491a488f2e08b22dee3a1ced7b3d4ce51.tar.gz
Correctly treat built-in method (method descriptors) as methods
This fixes a bug where method descriptors were treated as data descriptors. As the builtin_method_descriptor type is not exported anywhere in Python, we check for the name here. As we know that it is a descriptor, this should not be a problem.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index f193947d5..f19334a0e 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -1164,7 +1164,8 @@ class AttributeDocumenter(ClassLevelDocumenter):
@classmethod
def can_document_member(cls, member, membername, isattr, parent):
isdatadesc = isdescriptor(member) and not \
- isinstance(member, cls.method_types)
+ isinstance(member, cls.method_types) and not \
+ type(member).__name__ == "method_descriptor"
return isdatadesc or (not isinstance(parent, ModuleDocumenter)
and not inspect.isroutine(member)
and not isinstance(member, class_types))