Closes #1155: Fix autodocumenting C-defined methods as attributes in Python 3.

This commit is contained in:
Georg Brandl
2014-01-12 16:43:14 +01:00
parent 3f1235e2ea
commit aac72f175a
2 changed files with 4 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ Bugs fixed
* #1181: Report option errors in autodoc directives more gracefully.
* #1155: Fix autodocumenting C-defined methods as attributes in Python 3.
Documentation
-------------

View File

@@ -1244,7 +1244,8 @@ class AttributeDocumenter(ClassLevelDocumenter):
def can_document_member(cls, member, membername, isattr, parent):
isdatadesc = isdescriptor(member) and not \
isinstance(member, cls.method_types) and not \
type(member).__name__ in ("type", "method_descriptor")
type(member).__name__ in ("type", "method_descriptor",
"instancemethod")
return isdatadesc or (not isinstance(parent, ModuleDocumenter)
and not inspect.isroutine(member)
and not isinstance(member, class_types))