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

This commit is contained in:
Mark Shannon 2022-04-21 19:08:36 +01:00 committed by GitHub
parent 5974827c71
commit d44815cabc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 7 deletions

View file

@ -1159,6 +1159,12 @@ C API Changes
as its second parameter, instead of ``PyFrameObject*``.
See :pep:`523` for more details of how to use this function pointer type.
* :c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take
an additional ``exception_table`` argument.
Using these functions should be avoided, if at all possible.
To get a custom code object: create a code object using the compiler,
then get a modified version with the ``replace`` method.
New Features
------------