This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: collections.abc.Sequence index implementation
Type: behavior Stage: resolved
Components: Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: LordVilgefortz, kj
Priority: normal Keywords:

Created on 2021-06-30 16:24 by LordVilgefortz, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg396783 - (view) Author: Maciej Kopeć (LordVilgefortz) Date: 2021-06-30 16:24
Hello,

https://github.com/python/cpython/blob/3.9/Lib/_collections_abc.py#L1012
Shouldn't the loop condition be i <= 0 not i < 0? The implementation now is causing not to search in 1-element sequences, since it raises ValueError. Please let me know if this is the expected behaviour.

Kind regards,
Maciej Kopeć
msg396784 - (view) Author: Maciej Kopeć (LordVilgefortz) Date: 2021-06-30 16:29
Sorry for the hastily posted issue, when stop is not given this should work properly, and since stop is exclusive in python, this shall be expected behaviour.
msg396785 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2021-06-30 17:29
Closing this issue since OP(Maciej) has marked it as "not a bug".
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88707
2021-06-30 17:29:43kjsetstatus: open -> closed

nosy: + kj
messages: + msg396785

stage: resolved
2021-06-30 16:29:10LordVilgefortzsetresolution: not a bug
messages: + msg396784
2021-06-30 16:24:29LordVilgefortzcreate