[Python-3000] PEP 3101 update

Michael Urman murman at gmail.com
Thu Jun 22 15:43:50 CEST 2006

On 6/22/06, Nick Coghlan <ncoghlan at gmail.com> wrote:
> However, I realised that there's an approach that is aesthetically pleasing
> and doesn't require using str() for this - simply consider the leading '{0:'
> and trailing '}' to be implicit if there are no braces at all in the supplied
> format string.
> Then you could do things like:
[examples with missing quotes omitted]

>>> "The implicit braces scare me, for I am weak".format(10)

(Assuming lenient mode, and that str.format raises ValueError for such a case)

Michael Urman  http://www.tortall.net/mu/blog

More information about the Python-3000 mailing list