This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients brett.cannon, eric.snow, grahamd, ncoghlan
Date 2016-10-11.04:06:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
(added Graham Dumpleton to the nosy list to ask if this change may impact mod_wsgi for 3.7)

+1 on the general idea, but given that the current field is a public part of the interpreter state, the replacement access API should really be public as well - we can't be sure folks will always be going through the "PyImport_GetModuleDict()" API.

If you replace the addition of the `_PyImport_GetModuleDict` API with a public `PyInterpreterState_GetModuleDict` API, I think that will cover it - the new calls would just be "PyInterpreterState_GetModuleCache(tstate->interp)" rather than `_PyImport_GetModuleDict(tstate)`

Folks accessing this field directly can then define their own shim function if PyInterpreterState_GetModuleCache isn't defined.

(The rationale for the GetModuleDict -> GetModuleCache change is that "ModuleDict" is ambiguous - every module has a dict. For PyImport_* we're stuck with it, but the "PyImport" prefix at least gives a hint that the reference might be to the sys.modules cache. That affordance doesn't exist for the "PyInterpeterState" prefix.
Date User Action Args
2016-10-11 04:06:06ncoghlansetrecipients: + ncoghlan, brett.cannon, grahamd, eric.snow
2016-10-11 04:06:06ncoghlansetmessageid: <>
2016-10-11 04:06:06ncoghlanlinkissue28411 messages
2016-10-11 04:06:06ncoghlancreate