Germán L. Osella Massa <[email protected]> added the comment:
Well, using negative indexes for fields can be thought as a new feature with
all the consequences mentioned before BUT negative indexes for accessing
elements from a sequence, IMHO, is something that anyone would expected to
work. That's why at first I thought it was a bug and I fill an issue about it.
The code that parses the fields and the indexes is the same, so when I change
it to accept negative indexes, it worked for both cases. I'm attaching a patch
that checks if a negative index is used in a field and reverts to the old
behavior in that case, allowing only negative indexes for accessing sequences (
"{-1}" will raise KeyError because it will be threated as '-1').
Perhaps in this way this issue could be partially fixed.
----------
keywords: +patch
Added file:
http://bugs.python.org/file17768/format_no_fields_with_negative_indexes-2.7.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7951>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com