modernize some Python code
Since we now require Python 3.6, we can use f-strings instead of format() to make the code more readable. * doc/org/tut01.org, doc/org/tut02.org, doc/org/tut03.org, doc/org/tut21.org, doc/org/tut24.org, doc/org/tut90.org, python/spot/__init__.py, python/spot/jupyter.py, tests/python/acc.py, tests/python/acc_cond.ipynb, tests/python/complement_semidet.py, tests/python/decompose.ipynb, tests/python/formulas.ipynb, tests/python/highlighting.ipynb, tests/python/ipnbdoctest.py, tests/python/ltlf.py, tests/python/parity.ipynb, tests/python/product.ipynb, tests/python/relabel.py, tests/python/satmin.ipynb, tests/python/stutter-inv.ipynb, tests/python/twagraph-internals.ipynb, tests/python/zlktree.ipynb: Use f-strings.
This commit is contained in:
parent
df44f7a5c2
commit
7ac570fa3f
23 changed files with 292 additions and 327 deletions
|
|
@ -159,9 +159,9 @@ The Python equivalent is similar:
|
|||
|
||||
# kindstr() prints the name of the operator
|
||||
# size() return the number of operands of the operators
|
||||
print("{}, {} children".format(f.kindstr(), f.size()))
|
||||
print(f"{f.kindstr()}, {f.size()} children")
|
||||
# [] accesses each operand
|
||||
print("left: {f[0]}, right: {f[1]}".format(f=f))
|
||||
print(f"left: {f[0]}, right: {f[1]}")
|
||||
# you can also iterate over all operands using a for loop
|
||||
for child in f:
|
||||
print(" *", child)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue