From 4e1a557ed6886ac67eb08122b5081c6464b699a3 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 17 Oct 2019 17:30:04 -0700 Subject: 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. --- pyparsing.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'pyparsing.py') diff --git a/pyparsing.py b/pyparsing.py index 48720f0..f4f0735 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -2385,9 +2385,6 @@ class ParserElement(object): return vars(self) == vars(other) return False - def __ne__(self, other): - return not (self == other) - def __hash__(self): return id(self) -- cgit v1.2.1