Note a few implementation details or restrictions.

This commit is contained in:
Eric V. Smith 2015-08-25 16:38:29 -04:00
parent 1c0b0ee97a
commit 68a8d4e43c
1 changed files with 23 additions and 0 deletions

View File

@ -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(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
==========