Skip to content

Check for type consistency for PyUnicodeError API #127691

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
picnixz opened this issue Dec 6, 2024 · 2 comments
Closed

Check for type consistency for PyUnicodeError API #127691

picnixz opened this issue Dec 6, 2024 · 2 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@picnixz
Copy link
Member

picnixz commented Dec 6, 2024

Feature or enhancement

Proposal:

This is a follow-up to #123380 (comment).

The idea is to add assertion type-checks when calling helper functions on unicode objects:

    assert(PyObject_TypeCheck(exc, (PyTypeObject*)&PyExc_UnicodeError));

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

@picnixz picnixz added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Dec 6, 2024
@picnixz picnixz self-assigned this Dec 6, 2024
@encukou
Copy link
Member

encukou commented Dec 13, 2024

Thank you for the fix!
Do you want to add more, or should we close the issue?

@picnixz
Copy link
Member Author

picnixz commented Dec 13, 2024

I don't think I'll add more for this specific task. If I find something else I forgot, I'll just reuse it. I'll close this one as completed. Thanks for the merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants