MCPcopy Index your code
hub / github.com/RustPython/RustPython / _caller

Function _caller

Lib/typing.py:1894–1903  ·  view source on GitHub ↗
(depth=1, default='__main__')

Source from the content-addressed store, hash-verified

1892
1893
1894def _caller(depth=1, default='__main__'):
1895 try:
1896 return sys._getframemodulename(depth + 1) or default
1897 except AttributeError: # For platforms without _getframemodulename()
1898 pass
1899 try:
1900 return sys._getframe(depth + 1).f_globals.get('__name__', default)
1901 except (AttributeError, ValueError): # For platforms without _getframe()
1902 pass
1903 return None
1904
1905def _allow_reckless_class_checks(depth=2):
1906 """Allow instance and class checks for special stdlib modules.

Callers 4

NamedTupleFunction · 0.85
TypedDictFunction · 0.85
__init__Method · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected