Skip to content

Commit

Permalink
cleaner _IdRef.__eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Oct 14, 2024
1 parent d5e539f commit 408d1ae
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/trio/_core/_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ def __eq__(self, other: object) -> bool:
return NotImplemented

my_obj = None
other_obj: Any = None
try:
my_obj = self()
other_obj = other()
return my_obj is not None and my_obj is other_obj
return my_obj is not None and my_obj is other()
finally:
del my_obj, other_obj
del my_obj

# we're overriding a builtin so we do need this
def __ne__(self, other: object) -> bool:
Expand Down

0 comments on commit 408d1ae

Please sign in to comment.