diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-17 17:15:17 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-17 19:15:17 -0500 |
commit | 6fcd838cadce0f53f56b4316a4fc8740175891ce (patch) | |
tree | cf76afbc530969c47619189d458cd3b7fc0ef73a /examples | |
parent | 8396c6d94fda5faf90b1a93ffcdf390613db0590 (diff) | |
download | pyparsing-git-6fcd838cadce0f53f56b4316a4fc8740175891ce.tar.gz |
Py3 cleanup: Remove __nonzero__ method (#142)
In Python 3, the __nonzero__ method was renamed to __bool__. It no
longer exists as a magic method.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/simpleBool.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/simpleBool.py b/examples/simpleBool.py index d1df9a5..28490a2 100644 --- a/examples/simpleBool.py +++ b/examples/simpleBool.py @@ -25,7 +25,7 @@ class BoolOperand(object): def __str__(self):
return self.label
__repr__ = __str__
- __nonzero__ = __bool__
+
class BoolBinOp(object):
def __init__(self,t):
@@ -36,7 +36,7 @@ class BoolBinOp(object): def __bool__(self):
return self.evalop(bool(a) for a in self.args)
__nonzero__ = __bool__
- __repr__ = __str__
+
class BoolAnd(BoolBinOp):
reprsymbol = '&'
@@ -55,7 +55,7 @@ class BoolNot(object): def __str__(self):
return "~" + str(self.arg)
__repr__ = __str__
- __nonzero__ = __bool__
+
TRUE = Keyword("True")
FALSE = Keyword("False")
|