You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure unpythonic handles negative indices the same way as standard Python.
Most of the code should already be correct, but particularly, at least in the unpythonic.collections module (see _make_negidx_converter), I've accidentally modded by the length instead of just adding the length once when it gets a negative index.
(This may well be the only place that needs fixing. Probably still a good idea to grep for the % operator in all of the codebase.)
The current behavior may hide some IndexErrors in user code (e.g. trying to access lst[-8] when len(lst) == 5), and should be considered a bug.
The text was updated successfully, but these errors were encountered:
Make sure
unpythonic
handles negative indices the same way as standard Python.Most of the code should already be correct, but particularly, at least in the unpythonic.collections module (see
_make_negidx_converter
), I've accidentally modded by the length instead of just adding the length once when it gets a negative index.(This may well be the only place that needs fixing. Probably still a good idea to grep for the
%
operator in all of the codebase.)The current behavior may hide some
IndexError
s in user code (e.g. trying to accesslst[-8]
whenlen(lst) == 5
), and should be considered a bug.The text was updated successfully, but these errors were encountered: