Message99340
http://docs.python.org/library/string.html#formatstrings
field_name ::= (identifier | integer) ("." attribute_name | "[" element_index "]")*
element_index ::= integer
Subsequent text indicates __getitem__() is used but does not overtly say that a string can be used; but
http://docs.python.org/whatsnew/2.6.html#pep-3101-advanced-string-formatting
gives the example
>>> 'Content-type: {0[.mp4]}'.format(mimetypes.types_map)
and clearly '.mp4' is passed to __getitem__(); a string, not an integer.
Clearly one of these is wrong !
Given that the "what's new" doc goes into some detail about how the content of [...] gets parsed, I'm guessing it's right and the grammar is wrong. |
|
Date |
User |
Action |
Args |
2010-02-14 11:29:06 | eddy | set | recipients:
+ eddy, georg.brandl |
2010-02-14 11:29:06 | eddy | set | messageid: <1266146946.63.0.7361643831.issue7928@psf.upfronthosting.co.za> |
2010-02-14 11:28:06 | eddy | link | issue7928 messages |
2010-02-14 11:28:05 | eddy | create | |
|