diff options
| author | Marc Abramowitz <marc@marc-abramowitz.com> | 2015-03-06 09:11:39 -0800 |
|---|---|---|
| committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2015-03-06 09:11:39 -0800 |
| commit | 01e38bed190a1278f231f101431e2d09071de678 (patch) | |
| tree | 18f00cc4dfdc749c3b26e743f9a0121cc9c929ea | |
| parent | cbc3c959feecae75c1ce7864543c7f3a14b65ab0 (diff) | |
| download | python-setuptools-git-01e38bed190a1278f231f101431e2d09071de678.tar.gz | |
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
| -rw-r--r-- | pkg_resources/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 2ce663d2..7701292b 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -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: |
