Skip to content

gh-136572: fix IndexError in pydoc.replace #136574

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

Closed

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jul 12, 2025

I don't think those functions are part of the public API, but as they are publicly named, I'll still add the NEWS entry just in case.

@serhiy-storchaka I actually wondered between raising a TypeError and a ValueError but I went with a TypeError as it's what we raise when something doesn't match a signature (in some sense, we can assume that we have infinitely many overloads of the form replace(text, p1, p2, ..., pN, p{N+1})).

@picnixz
Copy link
Member Author

picnixz commented Jul 12, 2025

Since this isn't part of the public API, I can also replace the exception with an assertion. WDYT?

@picnixz picnixz closed this Jul 12, 2025
@picnixz picnixz deleted the fix/pydoc/replace-index-error-136572 branch July 12, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy