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

Method source_to_code

Lib/importlib/_bootstrap_external.py:801–808  ·  view source on GitHub ↗

Return the code object compiled from source. The 'data' argument can be any object type that compile() supports.

(self, data, path, fullname=None, *, _optimize=-1)

Source from the content-addressed store, hash-verified

799 return decode_source(source_bytes)
800
801 def source_to_code(self, data, path, fullname=None, *, _optimize=-1):
802 """Return the code object compiled from source.
803
804 The 'data' argument can be any object type that compile() supports.
805 """
806 return _bootstrap._call_with_frames_removed(compile, data, path, 'exec',
807 dont_inherit=True, optimize=_optimize,
808 module=fullname)
809
810 def get_code(self, fullname):
811 """Concrete implementation of InspectLoader.get_code.

Callers 1

get_codeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected