mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1155: Fix autodocumenting C-defined methods as attributes in Python 3.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user