Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collections.abc.Sequence index implementation #88707

Closed
mpkopec mannequin opened this issue Jun 30, 2021 · 3 comments
Closed

collections.abc.Sequence index implementation #88707

mpkopec mannequin opened this issue Jun 30, 2021 · 3 comments
Labels
3.9 only security fixes type-bug An unexpected behavior, bug, or error

Comments

@mpkopec
Copy link
Mannequin

mpkopec mannequin commented Jun 30, 2021

BPO 44541
Nosy @Fidget-Spinner, @mpkopec

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-06-30.17:29:43.266>
created_at = <Date 2021-06-30.16:24:29.078>
labels = ['type-bug', 'invalid', '3.9']
title = 'collections.abc.Sequence index implementation'
updated_at = <Date 2021-06-30.17:29:43.264>
user = 'https://github.com/mpkopec'

bugs.python.org fields:

activity = <Date 2021-06-30.17:29:43.264>
actor = 'kj'
assignee = 'none'
closed = True
closed_date = <Date 2021-06-30.17:29:43.266>
closer = 'kj'
components = []
creation = <Date 2021-06-30.16:24:29.078>
creator = 'LordVilgefortz'
dependencies = []
files = []
hgrepos = []
issue_num = 44541
keywords = []
message_count = 3.0
messages = ['396783', '396784', '396785']
nosy_count = 2.0
nosy_names = ['kj', 'LordVilgefortz']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue44541'
versions = ['Python 3.9']

@mpkopec
Copy link
Mannequin Author

mpkopec mannequin commented Jun 30, 2021

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ć

@mpkopec mpkopec mannequin added 3.9 only security fixes type-bug An unexpected behavior, bug, or error labels Jun 30, 2021
@mpkopec
Copy link
Mannequin Author

mpkopec mannequin commented Jun 30, 2021

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.

@mpkopec mpkopec mannequin added invalid labels Jun 30, 2021
@Fidget-Spinner
Copy link
Member

Closing this issue since OP(Maciej) has marked it as "not a bug".

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant