Message 336670 - Python tracker (original) (raw)

Message336670

Author ncoghlan
Recipients ncoghlan
Date 2019-02-26.13:46:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id 1551188802.37.0.811137397494.issue36124@roundup.psfhosted.org
In-reply-to
Content
(New issue derived from https://bugs.python.org/issue35886#msg336501 ) cffi needs a generally available way to get access to a caching dict for the currently active subinterpreter. Currently, they do that by storing it as an attribute in the builtins namespace: https://bitbucket.org/cffi/cffi/src/07d1803cb17b230571e3155e52082a356b31d44c/c/call_python.c?fileviewer=file-view-default As a result, they had to amend their code to include the CPython internal headers in 3.8.x, in order to regain access to the "builtins" reference. Armin suggested that a nicer way for them to achieve the same end result is if there was a PyInterpreter_GetDict() API, akin to https://docs.python.org/3/c-api/init.html#c.PyThreadState_GetDict That way they could store their cache dict in there in 3.8+, and only use the builtin dict on older Python versions.
History
Date User Action Args
2019-02-26 13:46:42 ncoghlan set recipients: + ncoghlan
2019-02-26 13:46:42 ncoghlan set messageid: 1551188802.37.0.811137397494.issue36124@roundup.psfhosted.org
2019-02-26 13:46:42 ncoghlan link issue36124 messages
2019-02-26 13:46:42 ncoghlan create