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

bpo-44110: Improve string's __getitem__ error message #26042

Merged
merged 3 commits into from
Jun 27, 2021

Conversation

miguendes
Copy link
Contributor

@miguendes miguendes commented May 11, 2021

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jun 18, 2021
@akulakov
Copy link
Contributor

A similar enhancement to list IndexError msg was recently rejected for performance reasons. I wonder if the same objection may apply here (most likely less so because the same pattern of catching index errors in a loop would be used rarely with strings). I will try to check performance later today, though I was having some odd issues with pyperf (but this may be a good chance to debug them :) ).

related issue:
https://bugs.python.org/issue44166

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jun 27, 2021
@akulakov
Copy link
Contributor

After looking at the pattern that was an issue with the list IndexError, it should not apply to strings, so please ignore my comment!

@serhiy-storchaka
Copy link
Member

Yes, because it is a TypeError, not IndexError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants