[Python-ideas] String formatting and namedtuple

Bruce Leban bruce at leapyear.org
Mon Feb 16 20:22:56 CET 2009

On Thu, Feb 12, 2009 at 11:24 AM, Terry Reedy <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.

--- Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090216/1ddbabb5/attachment.html>

More information about the Python-ideas mailing list