[issue40429] [C API] PyThreadState_GetFrame() and PyFrame_GetCode() should return a strong refrence

STINNER Victor report at bugs.python.org
Tue Apr 28 17:55:17 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

I recently added PyThreadState_GetFrame() and PyFrame_GetCode() functions to the C API of Python 3.9.

Currently, these functions return borrowed references.

I asked on capi-sig and Brett confirms that borrowed refrences should be avoided:
https://mail.python.org/archives/list/capi-sig@python.org/thread/LHESBBB3IYTXMBUKQ3WZI5CWB4WUH5YZ/

Borrowed references should be avoidedd!
https://github.com/vstinner/misc/blob/master/cpython/pep-opaque-c-api.rst#borrowed-references

I will work on a PR to modify these functions to return a strong reference instead.

----------
components: C API
messages: 367570
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] PyThreadState_GetFrame() and PyFrame_GetCode() should return a strong refrence
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40429>
_______________________________________


More information about the Python-bugs-list mailing list