Removed being able to combine 'f' with 'u'.

This commit is contained in:
Eric V. Smith 2015-09-12 11:59:53 -04:00
parent 78c0674c85
commit c02acaa227
1 changed files with 9 additions and 2 deletions

View File

@ -173,8 +173,7 @@ In source code, f-strings are string literals that are prefixed by the
letter 'f' or 'F'. Everywhere this PEP uses 'f', 'F' may also be
used. 'f' may be combined with 'r', in either order, to produce raw
f-string literals. 'f' may not be combined with 'b': this PEP does not
propose to add binary f-strings. 'f' may also be combined with 'u', in
either order, although adding 'u' has no effect.
propose to add binary f-strings. 'f' may not be combined with 'u'.
When tokenizing source files, f-strings use the same rules as normal
strings, raw strings, binary strings, and triple quoted strings. That
@ -661,6 +660,14 @@ If you feel you must use lambdas, they may be used inside of parentheses::
>>> f'{(lambda x: x*2)(3)}'
'6'
Can't combine with 'u'
--------------------------
The 'u' prefix was added to Python 3.3 in PEP 414 as a means to ease
source compatibility with Python 2.7. Because Python 2.7 will never
support f-strings, there is nothing to be gained by being able to
combine the 'f' prefix with 'u'.
Examples from Python's source code
==================================