[Python-ideas] String formatting and namedtuple

Terry Reedy tjreedy at udel.edu
Mon Feb 16 20:59:09 CET 2009


Bruce Leban wrote:
>>> On Thu, Feb 12, 2009 at 11:24 AM, Terry Reedy 
> <tjreedy at udel.edu 
> <mailto:tjreedy at udel.edu>> wrote:
>>> PROPOSAL: Allow the simple case to stay simple. Allow field names
> to be omitted for all fields in a string and then default to 0, 1,
> ... so that example above could be written as
>> > >> msg = "{} == {}".format
>> Given that computers are glorified counting machines, it *is* a bit
> annoying to be required to do the counting manually.
>>> Explicit syntax is better imho:
> "The answers are {.} and {.}.".format(x,y)
>> I'm suggesting a bare dot because it looks like something rather than 
> nothing and this syntax is currently invalid.

-1
There is nothing 'explicit' about '.'.
{} is just as currently invalid.
The purpose of my proposal is to make the simple case simple.
In terms of keystrokes, unshift - . - shift is as bad as unshift - 0 - 
shift.
tjr


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /