[Python-Dev] converting the stdlib to str.format

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 6 05:39:33 CEST 2008


Nick Coghlan wrote:
> Maybe we should ditch support for 
> positional arguments and just accept a single dictionary as the sole 
> parameter to format().
>> "{num} occurs {num} times in this format string".format(dict(num=2))

If named arguments were to become mandatory, I'd want
to be able to write that as
 "...{num}...".format(num = 2)
-- 
Greg


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /