diff --git a/peps/pep-0793.rst b/peps/pep-0793.rst index 562278f0582..356cbca0066 100644 --- a/peps/pep-0793.rst +++ b/peps/pep-0793.rst @@ -318,12 +318,15 @@ will return 0 on success and -1 on failure: A new ``PyType_GetModuleByToken`` function will be added, with a signature like the existing ``PyType_GetModuleByDef`` but a ``void *token`` argument, -and the same behaviour except matching tokens rather than only defs. +and the same behaviour except matching tokens rather than only defs, +and returning a strong reference. For easier backwards compatibility, the existing ``PyType_GetModuleByDef`` -will be changed to work exactly like ``PyType_GetModuleByToken`` -- that is, -it will allow a token (cast to a ``PyModuleDef *`` pointer) as the -*def* argument. +will be changed to also allow a token (cast to a ``PyModuleDef *`` pointer) as +the *def* argument. +That is, ``PyType_GetModuleByToken`` and ``PyType_GetModuleByDef`` will differ +only in the formal signature of the second argument and by returning a +borrowed vs. strong reference. (The ``PyModule_GetDef`` function will not get a similar change, as users may access members of its result.)