gh-92154: Expose PyCode_GetCode in the C API (GH-92168)

This commit is contained in:
Ken Jin 2022-05-03 20:13:13 +07:00 committed by GitHub
parent 1d4a9a45b7
commit 6c7249f265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 0 deletions

View file

@ -1412,6 +1412,11 @@ C API Changes
To get a custom code object: create a code object using the compiler,
then get a modified version with the ``replace`` method.
* :c:type:`PyCodeObject` no longer has a ``co_code`` field. Instead,
use ``PyObject_GetAttrString(code_object, "co_code")`` or
:c:func:`PyCode_GetCode` to get the underlying bytes object.
(Contributed by Brandt Bucher in :issue:`46841` and Ken Jin in :gh:`92154`.)
New Features
------------