"Guido van Rossum" <[EMAIL PROTECTED]> writes:

> My personal suggestion is to stay close to the .NET formatting language:
>
>   name_specifier [',' width_specifier] [':' conversion_specifier]

A problem is that this format requires brute memorization to remember
where to put things.  If letters were used to prefix specifications,
like "w" for width and "p" for precision, one could write something
like:

   >>> 'The average is: {0:w8p2} today.'.format(avg)
   'The average is:     7.24 today.'

This would give users at least a shot at mnemonically parsing - and
constructing - format strings, and eliminate the problem of having to
decide what goes first.

If, on the other hand, all we have to go on are some commas and
colons, then I, for one, will probably always have to look things up -
just like I always did for C-style percent-sign format specifications
in the first place.

-- 
Brandon Craig Rhodes   [EMAIL PROTECTED]   http://rhodesmill.org/brandon
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to