Guido van Rossum wrote:
> On 9/1/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
>>string.Template is a bit too simplified. But perhaps it can be adapted.
>>We still want some way to express %r, %6.2f, etc. Since string
>>formatting has been around since Tim was in diapers, we should probably
>>start by looking at the solutions used by other languages. With Py3.0,
>>we have a real opportunity to break-away from doing things the way C
>>does it.
>
>
> Hrm. Most other languages these days do floating point formatting the
> way C does it. I'm happy to look for other ways to invoke the thing,
> but I think that we shouldn't tinker with %6.2f. (In fact, the major
> complaint is about the one place where I *did* tinker with it --
> %(boo)s.)
>
> Maybe the ${boo} form can be extended to allow ${boo%6.2f} ???
>
> Unfortunately that would prevent a different extension of ${boo}: %{boo+far}.
May I also suggest the following shortcut for creating and evaluating a
string template. (Ever since I thought of this, I've actually used this
in code without thinking... it's just too natural):
message = $"Hello, $name!"
Shane
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com