Skip to content

Commit

Permalink
Fix #8583: autodoc: Unnecessary object comparision via __eq__ method
Browse files Browse the repository at this point in the history
It should be compared by `is` keyword instead.
  • Loading branch information
tk0miya committed Dec 24, 2020
1 parent 0432604 commit 5c39d0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ def import_object(self, raiseerror: bool = False) -> bool:
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]]:
Expand Down

0 comments on commit 5c39d0c

Please sign in to comment.