Nick Coghlan <[EMAIL PROTECTED]> wrote:
> With the above changes, the following would work:
> "$1: $2".format("Number of bees", "0.5")
> And produce:
> "Number of bees: 0.5"
>
> When pre-compiling string.Templates, the keyword method is
> significantly clearer, but if the syntax was accessible through a
> string method, then being able to use positional arguments would
> be very handy.
As long as named arguments don't get lost, that's fine. I
often use templates stored in variables/passed around as
arguments, where the positional form is not clear at all:
template.format("Number of bees", "0.5")
--
Christian Tanzer http://www.c-tanzer.at/
_______________________________________________
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