[Python-checkins] peps: Removed being able to combine 'f' with 'u'.
eric.smith
python-checkins at python.org
Sat Sep 12 17:59:45 CEST 2015
https://hg.python.org/peps/rev/29f40cf868a8
changeset: 6050:29f40cf868a8
user: Eric V. Smith <eric at trueblade.com>
date: Sat Sep 12 11:59:53 2015 -0400
summary:
Removed being able to combine 'f' with 'u'.
files:
pep-0498.txt | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/pep-0498.txt b/pep-0498.txt
--- a/pep-0498.txt
+++ b/pep-0498.txt
@@ -173,8 +173,7 @@
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 @@
>>> 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
==================================
--
Repository URL: https://hg.python.org/peps
More information about the Python-checkins
mailing list