API reference

python:arxjit:arxjit.extract_source

function extract_source

extract_source(fn: PyFunc) -> ExtractedSource

Source: packages/arxjit/src/arxjit/source.py:338

Declared as: python:arxjit:arxjit.source.extract_source

Extract and parse the source of a decorated function.

Retrieves the source block with inspect.getsourcelines (which follows wrapped, so a JitFunction resolves to the function it wraps) and parses it with ast.parse. An indented block is parsed inside a synthetic "if True:" wrapper rather than dedented, so the text is never modified and every node keeps real file lines and columns. The decorators are dropped from the returned node and source; async definitions are extracted here and left for the validation stage to accept or reject.

Parameters

Returns

Type: ExtractedSource

Raises

Search documentation

Type to search.