PyDocs

Nav

Python Runtime Services

_getframemodulename

sys

function · Added in 3.12
  • _getframemodulename([depth])
Return the name of the module for a calling frame.

The default depth returns the module containing the call to this API.
A more typical use in a library will pass a depth of 1 to get the user's
module rather than the library module.

If no frame, module, or name can be found, returns None.

The official docs include a CPython implementation detail for this entry.

0 Examples
No examples for sys/_getframemodulename.
See Also
No see-alsos for sys/_getframemodulename
0 Notes
No notes for _getframemodulename