Skip to content

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

Merged
markshannon merged 4 commits intopython:mainfrom
faster-cpython:doc-code-object-with-dire-warnings
Apr 21, 2022
Merged

GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty less dangerous.#91790
markshannon merged 4 commits intopython:mainfrom
faster-cpython:doc-code-object-with-dire-warnings

Conversation

@markshannon
Copy link
Copy Markdown
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
Copy Markdown
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.

@markshannon markshannon merged commit d44815c into python:main Apr 21, 2022
@vstinner
Copy link
Copy Markdown
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