From 83252516da213494307bc4fbd6191b49b255d8a0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 25 Nov 2022 11:00:36 -0500 Subject: [PATCH] Add docstring to __eq__, covering NotImplemented types. --- zipp/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zipp/__init__.py b/zipp/__init__.py index 1757e71..f7fe44d 100644 --- a/zipp/__init__.py +++ b/zipp/__init__.py @@ -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)