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

Method source_to_code

Lib/importlib/abc.py:142–147  ·  view source on GitHub ↗

Compile 'data' into a code object. The 'data' argument can be anything that compile() can handle. The'path' argument should be where the data was retrieved (when applicable).

(data, path='<string>', fullname=None)

Source from the content-addressed store, hash-verified

140
141 @staticmethod
142 def source_to_code(data, path='<string>', fullname=None):
143 """Compile 'data' into a code object.
144
145 The 'data' argument can be anything that compile() can handle. The'path'
146 argument should be where the data was retrieved (when applicable)."""
147 return compile(data, path, 'exec', dont_inherit=True, module=fullname)
148
149 exec_module = _bootstrap_external._LoaderBasics.exec_module
150

Callers 8

get_codeMethod · 0.95
compileFunction · 0.45
source_to_moduleMethod · 0.45
test_source_to_codeMethod · 0.45
_get_codeMethod · 0.45
get_codeMethod · 0.45

Calls 1

compileFunction · 0.50

Tested by 4

source_to_moduleMethod · 0.36
test_source_to_codeMethod · 0.36