[Python-ideas] Draft2 PEP on string interpolation
Mike Miller
python-ideas at mgmiller.net
Thu Aug 27 06:40:54 CEST 2015
With the major design decisions made, behold version 2 of my draft PEP on string
interpolation.
It's now significantly shorter due to removal of most of the i18n related
discussion, pruning, as well as simplification of the prose itself. I don't
expect many changes from here on:
https://bitbucket.org/mixmastamyk/docs/src/default/pep/pep-05XX.rst
TL;DR: Here is a summary table and comparisons with my current understanding of
the other proposals, please correct if they are now out of date:
String Interpolation PEP Comparison
===================================
================= ================= ================= =================
PEP PEP 498 PEP 501 Draft PEP
================= ================= ================= =================
Name Format/f-string Gen. Purpose Str… Expression-string
Prefix f'' i'' e''
Syntax str.format()+ .format+Template+ str.format()+
Returns String join expr… Object Object
Immediate Render Yes No Yes
Deferred Render No Yes, str, mutable Yes
I18n Support No Yes Input available
Escaping Hook No No Yes, manual
================= ================= ================= =================
The table can be found here and updated via pull-request:
https://bitbucket.org/mixmastamyk/docs/src/default/pep/pep_comparison.rst
-Mike
More information about the Python-ideas
mailing list