summaryrefslogtreecommitdiff
path: root/examples/simpleBool.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-10-24 20:11:14 -0700
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-10-24 22:11:14 -0500
commitf73e2571fb643a2afdde365eeee0fe0f3f4f5300 (patch)
treef9015586cee7efc5e60eee78a8ebcbaa4e9e953d /examples/simpleBool.py
parent696808023f10207461d7b22dc1d02cbed44e2bfa (diff)
downloadpyparsing-git-f73e2571fb643a2afdde365eeee0fe0f3f4f5300.tar.gz
Use pyupgrade to upgrade the code to use Python3 conventions (#138)
The pyupgrade project is available at https://github.com/asottile/pyupgrade and can be installed through pip. The pyupgrade tool automatically upgrades syntax for newer versions of the language. As pyparsing is now Python 3 only, can apply some cleanups and simplifications. Ran the tool using the following command: $ find . -name \*.py -exec pyupgrade --py3-plus {} \; For now, pyparsing.py was skipped while it is refactored to a package.
Diffstat (limited to 'examples/simpleBool.py')
-rw-r--r--examples/simpleBool.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/simpleBool.py b/examples/simpleBool.py
index 28490a2..81f5049 100644
--- a/examples/simpleBool.py
+++ b/examples/simpleBool.py
@@ -16,7 +16,7 @@ from pyparsing import infixNotation, opAssoc, Keyword, Word, alphas
# define classes to be built at parse time, as each matching
# expression type is parsed
-class BoolOperand(object):
+class BoolOperand:
def __init__(self,t):
self.label = t[0]
self.value = eval(t[0])
@@ -27,7 +27,7 @@ class BoolOperand(object):
__repr__ = __str__
-class BoolBinOp(object):
+class BoolBinOp:
def __init__(self,t):
self.args = t[0][0::2]
def __str__(self):
@@ -46,7 +46,7 @@ class BoolOr(BoolBinOp):
reprsymbol = '|'
evalop = any
-class BoolNot(object):
+class BoolNot:
def __init__(self,t):
self.arg = t[0][1]
def __bool__(self):