Serhiy Storchaka added the comment:

User code shouldn't allocate PyInterpreterState and PyThreadState structures, 
it only uses structures created by the interpreter. Changing the size of 
PyInterpreterState should be safe. The only possible breaking compatibility is 
if user code directly access co_extra_user_count, co_extra_freefuncs, 
async_gen_firstiter or async_gen_finalizer rather than using the API: 
_PyEval_RequestCodeExtraIndex(), _PyCode_GetExtra(), _PyCode_SetExtra(), 
_PyEval_GetAsyncGenFirstiter(), _PyEval_SetAsyncGenFirstiter(), 
_PyEval_GetAsyncGenFinalizer() and _PyEval_SetAsyncGenFinalizer().

Nick's idea about _preserve_36_ABI_1 and _preserve_36_ABI_2 should   address 
concerns about direct access to async_gen_firstiter and async_gen_finalizer. 
Direct access to co_extra_user_count and co_extra_freefuncs obviously can't be 
preserved.

PyInterpreterState and PyThreadState are not in the stable ABI. They are opaque 
types when use limited API. May be they should be made opaque for all user code 
(in 3.7+).

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30604>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to