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

GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty less dangerous. #91790

Merged

Conversation

markshannon
Copy link
Member

This PR documents that PyCodeNew and PyCode_NewWithPosOnlyArgs are risky and shouldn't be used.
I've also fixed PyCode_NewEmpty so that it isn't needlessly dangerous.

#88116

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall change LGTM and having an empty object which doesn't crash sounds like a good idea :-) I didn't check PyCode_New() and PyCode_NewWithPosOnlyArgs() arguments.

Doc/c-api/code.rst Show resolved Hide resolved
@markshannon markshannon merged commit d44815c into python:main Apr 21, 2022
@vstinner
Copy link
Member

Thanks, nice enhancement.

@markshannon markshannon deleted the doc-code-object-with-dire-warnings branch September 26, 2023 12:49
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.

3 participants