[Python-ideas] Customizing format()

Carl Johnson cmjohnson.mailinglist at gmail.com
Wed Mar 18 19:36:44 CET 2009


Carl Johnson wrote:

> I haven't entirely been following this conversation, so I may be
> missing something, but what about something like:
>
> "Balance = ${balance:{minilang}}".format(balance=1.00,
> minilang=mini_formatter(thousands_sep=",", ...))
>
> That way, even if the mini-language gets really confusing we'll have
> an easy to call function that manages it. I always thought it was
> weird that things co

Sorry, Google mail has been being weird lately, signing me out and
suddenly sending mail, etc.

…So, I always thought it was weird that {}s could nest in the new
format language, but if we have that capability, we may as well use
it.

-- Carl



More information about the Python-ideas mailing list