MCPcopy
hub / github.com/fluentpython/example-code-2e / run

Function run

18-with-match/lispy/py3.10/lis.py:197–203  ·  view source on GitHub ↗
(source: str)

Source from the content-addressed store, hash-verified

195################ command-line interface
196
197def run(source: str) -> Any:
198 global_env = Environment({}, standard_env())
199 tokens = tokenize(source)
200 while tokens:
201 exp = read_from_tokens(tokens)
202 result = evaluate(exp, global_env)
203 return result
204
205def main(args: list[str]) -> None:
206 if len(args) == 1:

Callers 8

test_factorialFunction · 0.90
test_gcdFunction · 0.90
test_quicksortFunction · 0.90
test_newtonFunction · 0.90
test_closureFunction · 0.90
test_closure_with_changeFunction · 0.90
test_closure_averagerFunction · 0.90
mainFunction · 0.70

Calls 5

EnvironmentClass · 0.70
standard_envFunction · 0.70
tokenizeFunction · 0.70
read_from_tokensFunction · 0.70
evaluateFunction · 0.70

Tested by 7

test_factorialFunction · 0.72
test_gcdFunction · 0.72
test_quicksortFunction · 0.72
test_newtonFunction · 0.72
test_closureFunction · 0.72
test_closure_with_changeFunction · 0.72
test_closure_averagerFunction · 0.72