[issue5237] Allow auto-numbered replacement fields in str.format() strings

David W. Lambert report at bugs.python.org
Fri Feb 13 04:56:16 CET 2009


David W. Lambert <lambertdw at corning.com> added the comment:

I am net yet fluent in format method.  I meant

":" where "#" appeared.

Anyway, I think you need the colon. 
 
If from
print('{0:9}'.format(33))

you make the argument number implicit and remove the colon you'd get

print('{9}'.format(33))

which does and should raise IndexError.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5237>
_______________________________________


More information about the Python-bugs-list mailing list