Skip to content

Commit

Permalink
Merge pull request #8614 from tk0miya/deprecate_AttributeDocumenter_i…
Browse files Browse the repository at this point in the history
…sinstanceattribute

refactor: Deprecate AttributeDocumenter.isinstanceattribute()
  • Loading branch information
tk0miya committed Dec 30, 2020
2 parents c994126 + c0f923e commit 21698c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Incompatible changes
Deprecated
----------

* ``sphinx.ext.autodoc.AttributeDocumenter.isinstanceattribute()``
* ``sphinx.ext.autodoc.importer.get_module_members()``

Features added
Expand Down
5 changes: 5 additions & 0 deletions doc/extdev/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ The following is a list of deprecated interfaces.
- (will be) Removed
- Alternatives

* - ``sphinx.ext.autodoc.AttributeDocumenter.isinstanceattribute()``
- 3.5
- 5.0
- N/A

* - ``sphinx.ext.autodoc.importer.get_module_members()``
- 3.5
- 5.0
Expand Down
2 changes: 2 additions & 0 deletions sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,8 @@ def document_members(self, all_members: bool = False) -> None:

def isinstanceattribute(self) -> bool:
"""Check the subject is an instance attribute."""
warnings.warn('AttributeDocumenter.isinstanceattribute() is deprecated.',
RemovedInSphinx50Warning)
# uninitialized instance variable (PEP-526)
with mock(self.config.autodoc_mock_imports):
try:
Expand Down

0 comments on commit 21698c1

Please sign in to comment.