Commit 01e38bed authored by Marc Abramowitz's avatar Marc Abramowitz

Add __ne__ method to Requirement class

It seems like if it has an `__eq__` method, it should probably have a `__ne__` method.

I ran into this while working on pip -- see https://github.com/pypa/pip/pull/2493#discussion_r25955295
parent cbc3c959
......@@ -2907,6 +2907,9 @@ class Requirement:
self.hashCmp == other.hashCmp
)
def __ne__(self, other):
return not self == other
def __contains__(self, item):
if isinstance(item, Distribution):
if item.key != self.key:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment