A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-June/080036.html below:

[Python-Dev] converting the stdlib to str.format

[Python-Dev] converting the stdlib to str.format [Python-Dev] converting the stdlib to str.formatSteven D'Aprano steve at pearwood.info
Wed Jun 4 16:19:10 CEST 2008
On Wed, 4 Jun 2008 11:28:40 pm Nick Coghlan wrote:

> > Not to mention that e.g. "%r" % s is much simpler than
> > "{0!r}".format(s) (if I got the format spec right).
>
> repr(s) is even simpler :)

Fair enough, and I see your smiley, but consider:

"X %r X" % s

"X {0!r} X".format(s)

"X " + repr(s) + " X"


I for one am excited to see advanced string formatting via .format(), 
but would be very disappointed if future Python versions removed the 
simplicity of %.


-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4