[Python-checkins] peps: Make examples easier to read by using '+' instead of ''.join().
eric.smith
python-checkins at python.org
Fri Sep 4 20:37:26 CEST 2015
https://hg.python.org/peps/rev/69caea87d71d
changeset: 6028:69caea87d71d
user: Eric V. Smith <eric at trueblade.com>
date: Fri Sep 04 14:37:43 2015 -0400
summary:
Make examples easier to read by using '+' instead of ''.join().
files:
pep-0498.txt | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pep-0498.txt b/pep-0498.txt
--- a/pep-0498.txt
+++ b/pep-0498.txt
@@ -242,7 +242,7 @@
Might be be evaluated as::
- ''.join(['abc', expr1.__format__(spec1), repr(expr2).__format__(spec2), 'def', str(spec3).__format__(''), 'ghi'])
+ 'abc' + expr1.__format__(spec1) + repr(expr2).__format__(spec2) + 'def' + str(spec3).__format__('') + 'ghi'
Expression evaluation
---------------------
@@ -325,7 +325,7 @@
While the exact method of this run time concatenation is unspecified,
the above code might evaluate to::
- ''.join(['ab', x.__format__(''), '{c}', 'str<', y.__format__('^4'), 'de'])
+ 'ab' + x.__format__('') + '{c}' + 'str<', y.__format__('^4') + 'de'
Error handling
--------------
--
Repository URL: https://hg.python.org/peps
More information about the Python-checkins
mailing list