[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

Matthew Barnett report at bugs.python.org
Mon Jun 14 17:31:01 CEST 2010


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

Re: msg107776.

If it looks like an integer (ie, can be converted to an integer by 'int') then it's positional, otherwise it's a key. An optimisation is to perform a quick check upfront to see whether it starts like an integer.

----------

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


More information about the Python-bugs-list mailing list