diff options
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | sphinx/ext/autodoc.py | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -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 ------------- diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index ad7b02bb..9d950a75 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -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)) |