This issue implements a proposal related to PEP-489 and PEP-630. **Decision:** * https://github.com/capi-workgroup/decisions/issues/34 **TODO:** - [x] Implement the feature - [x] Use it in `_PyStgInfo_FromType_NoState()` in `_ctypes.c` - [x] Ensure no performance regression in `PyType_GetModuleByDef()` and other functions affected by this feature on Windows PGO builds **TODO (optional):** - [x] Replace `PyType_GetModuleByDef()` in `defdict_or()` (`_collectionsmodule.c`) - [x] Replace `_PyType_GetModuleByDef2()` in `_decimal.c` - [x] Remove `_PyType_GetModuleByDef2()` ### Has this already been discussed elsewhere? I have already discussed this feature proposal on Discourse ### Links to previous discussion of this feature: * https://github.com/encukou/abi3/issues/19 * https://discuss.python.org/t/55598 <!-- gh-linked-prs --> ### Linked PRs * gh-121079 * gh-124163 * gh-124261 * gh-124323 * gh-124488 * gh-141644 <!-- /gh-linked-prs -->
This issue implements a proposal related to PEP-489 and PEP-630.
Decision:
TODO:
_PyStgInfo_FromType_NoState()in_ctypes.cPyType_GetModuleByDef()and other functions affected by this feature on Windows PGO buildsTODO (optional):
PyType_GetModuleByDef()indefdict_or()(_collectionsmodule.c)_PyType_GetModuleByDef2()in_decimal.c_PyType_GetModuleByDef2()Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
Linked PRs
PyType_GetBaseByToken()andPy_tp_tokenslot #124163_PyType_GetModuleByDef2private function #124261PyType_GetBaseByToken()performance #124323PyType_GetBaseByToken()and friends #124488