On Tue, Feb 22, 2011 at 6:01 PM, Steve Holden <steve at holdenweb.com> wrote: > ... It would appear from tests > that "{0[X]}".format(...) first tries to convert the string "X" to in > integer. If it succeeds then __getitem__() is called with the integer as an > argument, otherwise it is called with the string itself as an argument. Is > this correct? This is addressed in the PEP 3101: """ The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a string. """ http://www.python.org/dev/peps/pep-3101/ If current implementation does something more involved, I would say it is a bug.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4