diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-17 17:30:04 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-17 19:30:04 -0500 |
commit | 4e1a557ed6886ac67eb08122b5081c6464b699a3 (patch) | |
tree | 50e79239ce216e35beb4081b156dfb161aa970bc /examples | |
parent | 6fcd838cadce0f53f56b4316a4fc8740175891ce (diff) | |
download | pyparsing-git-4e1a557ed6886ac67eb08122b5081c6464b699a3.tar.gz |
Py3 cleanup: Remove unnecessary __ne__ method (#140)
Unlink Python 2, in Python 3, __ne__ defaults to the inverse of the
__eq__ method. Can remove the definitions that follow this default.
From the Python docs
https://docs.python.org/3/reference/datamodel.html#object.__ne__
> By default, __ne__() delegates to __eq__() and inverts the result
> unless it is NotImplemented.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/btpyparse.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/examples/btpyparse.py b/examples/btpyparse.py index 4fbbac8..1d8992b 100644 --- a/examples/btpyparse.py +++ b/examples/btpyparse.py @@ -22,8 +22,6 @@ class Macro(object): return 'Macro("%s")' % self.name
def __eq__(self, other):
return self.name == other.name
- def __ne__(self, other):
- return self.name != other.name
# Character literals
|