On Tue, Feb 22, 2011 at 6:01 PM, Steve Holden <st...@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. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com