MCPcopy Index your code
hub / github.com/python/cpython / monkey

Method monkey

Lib/test/test_inspect/test_inspect.py:916–920  ·  view source on GitHub ↗
(filename, module_globals=None)

Source from the content-addressed store, hash-verified

914 fn, source = '<test>', 'def x(): pass\n'
915 getlines = linecache.getlines
916 def monkey(filename, module_globals=None):
917 if filename == fn:
918 return source.splitlines(keepends=True)
919 else:
920 return getlines(filename, module_globals)
921 linecache.getlines = monkey
922 try:
923 ns = {}

Callers

nothing calls this directly

Calls 2

getlinesFunction · 0.85
splitlinesMethod · 0.45

Tested by

no test coverage detected