I'm against syntax for this, for all the reasons stated by others. Jerry Chen wrote: > Just one last note: I think my end goal here was to preserve the > visual clarity and separation between format string and format > parameters, as I much prefer: > > "%s %s %s" % (1, 2, 3) > > over > > "{0} {1} {2}".format(1, 2, 3) If it helps, in 3.1 and 2.7 this can be written as "{} {} {}".format(1, 2, 3) I'm not sure it helps for "visual clarity", but it definitely makes the typing easier for simple uses. > The former is a style I've grown accustomed to, and if % is indeed > being slated for removal in Python 3.2, then I will miss it sorely > (or... just get over it). I've basically come to accept that %-formatting can never go away, unfortunately. There are too many places where %-formatting is used, for example in logging Formatters. %-formatting either has to exist or it has to be emulated. Although if anyone has any suggestions for migrating uses like that, I'm interested. Eric.
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