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:
Alexandre Duret-Lutz 2024-03-26 20:35:10 +01:00
parent df44f7a5c2
commit 7ac570fa3f
23 changed files with 292 additions and 327 deletions

View file

@ -64,8 +64,8 @@
"for kind in ['min', 'max']:\n",
" for style in ['odd', 'even']:\n",
" for sets in range(1, 5):\n",
" name = 'parity {} {} {}'.format(kind, style, sets)\n",
" print('{:17} = {}'.format(name, spot.acc_code(name)))"
" name = f'parity {kind} {style} {sets}'\n",
" print(f'{name:17} = {spot.acc_code(name)}')"
]
},
{
@ -4949,7 +4949,7 @@
"</svg>\n"
],
"text/plain": [
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fc0d6bea0d0> >"
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f88de01ed30> >"
]
},
"metadata": {},
@ -5460,7 +5460,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.8"
}
},
"nbformat": 4,