Skip to content

Commit

Permalink
Add docstring to __eq__, covering NotImplemented types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 25, 2022
1 parent e587f31 commit 8325251
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zipp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ def __init__(self, root, at=""):
self.at = at

def __eq__(self, other):
"""
>>> Path(zipfile.ZipFile(io.BytesIO(), 'w')) == 'foo'
False
"""
if self.__class__ is not other.__class__:
return NotImplemented
return (self.root, self.at) == (other.root, other.at)
Expand Down

0 comments on commit 8325251

Please sign in to comment.