summaryrefslogtreecommitdiff
path: root/examples/romanNumerals.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/romanNumerals.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/romanNumerals.py')
-rw-r--r--examples/romanNumerals.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/romanNumerals.py b/examples/romanNumerals.py
index 6e675a9..757a925 100644
--- a/examples/romanNumerals.py
+++ b/examples/romanNumerals.py
@@ -60,13 +60,13 @@ roman_int_map = {}
for expected, (t, s, e) in enumerate(romanNumeral.scanString(tests), start=1):
orig = tests[s:e]
if t[0] != expected:
- print("{0} {1} {2}".format("==>", t, orig))
+ print("{} {} {}".format("==>", t, orig))
roman_int_map[orig] = t[0]
def verify_value(s, tokens):
expected = roman_int_map[s]
if tokens[0] != expected:
- raise Exception("incorrect value for {0} ({1}), expected {2}".format(s, tokens[0], expected ))
+ raise Exception("incorrect value for {} ({}), expected {}".format(s, tokens[0], expected ))
romanNumeral.runTests("""\
XVI