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-40170: Always define PyExceptionClass_Name as a function #24553

Merged

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Feb 16, 2021

Remove the macro variant, as it accessed PyTypeObject.tp_name directly.

https://bugs.python.org/issue40170

@erlend-aasland
Copy link
Contributor Author

@vstinner Would you mind reviewing this?

In related news: The NEWS item section for #24533, #24535, and #24548 were Core and Builtins, but in retrospect I see that C API would have been more fitting. Should I change them?

@vstinner vstinner merged commit cd80f43 into python:master Feb 17, 2021
@vstinner
Copy link
Member

In related news: The NEWS item section for #24533, #24535, and #24548 were Core and Builtins, but in retrospect I see that C API would have been more fitting. Should I change them?

Right, these changes impact the C API. If these changes were made after the latest Python 3.10 release, you can move the NEWS entries in a new PR. Otherwise, we can leave them, it's not a big deal.

@vstinner
Copy link
Member

Merged, thanks.

The function is only used to display errors, so I don't think that we need to micro-optimize the code (add an internal static inline function, for example), it's not "hot code". I consider that error handling is "cold code".

@erlend-aasland erlend-aasland deleted the bpo-40170/PyExceptionClass_Name branch February 17, 2021 11:00
@erlend-aasland
Copy link
Contributor Author

Right, these changes impact the C API. If these changes were made after the latest Python 3.10 release, you can move the NEWS entries in a new PR. Otherwise, we can leave them, it's not a big deal.

All right. I prefer to move them before the next alpha. I'll throw up a PR.

Thanks for reviewing 🙏🏻

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
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.

4 participants