diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-24 23:42:30 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-12-24 23:42:32 +0900 |
commit | 5c39d0c0688d011a26b806f9bcc90d194ad292f0 (patch) | |
tree | ef1f29ef1984da3de789af499783686043561f04 | |
parent | 043260481b59c922fea042a1e9bbc4ff32fa1069 (diff) | |
download | sphinx-git-5c39d0c0688d011a26b806f9bcc90d194ad292f0.tar.gz |
Fix #8583: autodoc: Unnecessary object comparision via ``__eq__`` method
It should be compared by `is` keyword instead.
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/ext/autodoc/__init__.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -22,6 +22,7 @@ Bugs fixed * #8567: autodoc: Instance attributes are incorrectly added to Parent class * #8566: autodoc: The ``autodoc-process-docstring`` event is emitted to the alias classes unexpectedly +* #8583: autodoc: Unnecessary object comparision via ``__eq__`` method * #8565: linkcheck: Fix PriorityQueue crash when link tuples are not comparable diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index 7a91d7d45..85f9f6de2 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1829,7 +1829,7 @@ class UninitializedGlobalVariableMixin(DataDocumenterMixinBase): return False def should_suppress_value_header(self) -> bool: - return (self.object == UNINITIALIZED_ATTR or + return (self.object is UNINITIALIZED_ATTR or super().should_suppress_value_header()) def get_doc(self, encoding: str = None, ignore: int = None) -> List[List[str]]: |