Note a few implementation details or restrictions.
This commit is contained in:
parent
1c0b0ee97a
commit
68a8d4e43c
23
pep-0498.txt
23
pep-0498.txt
|
@ -580,6 +580,29 @@ python-config.py::
|
||||||
print("Usage: {0} [{1}]".format(sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
|
print("Usage: {0} [{1}]".format(sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
|
||||||
print(f"Usage: {sys.argv[0]} [{'|'.join('--'+opt for opt in valid_opts)}]", file=sys.stderr)
|
print(f"Usage: {sys.argv[0]} [{'|'.join('--'+opt for opt in valid_opts)}]", file=sys.stderr)
|
||||||
|
|
||||||
|
Implementation limitations
|
||||||
|
==========================
|
||||||
|
|
||||||
|
Maximum of 255 expressions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Due to a CPython limit with the number of parameters to a function, an
|
||||||
|
f-string may not contain more that 255 expressions. This includes
|
||||||
|
expressions inside format specifiers. So this code would count as
|
||||||
|
having 2 expressions::
|
||||||
|
|
||||||
|
f'{x:.{width}}'
|
||||||
|
|
||||||
|
Expressions with side effects
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
xxx
|
||||||
|
|
||||||
|
Expressions used multiple times
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
xxx
|
||||||
|
|
||||||
References
|
References
|
||||||
==========
|
==========
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue