From c02acaa22718c78c369e0eac8454acd130712e3a Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Sat, 12 Sep 2015 11:59:53 -0400 Subject: [PATCH] Removed being able to combine 'f' with 'u'. --- pep-0498.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pep-0498.txt b/pep-0498.txt index dbfdab395..92b6fbe59 100644 --- a/pep-0498.txt +++ b/pep-0498.txt @@ -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 ==================================