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

Function run

18-with-match/lispy/py3.9/lis.py:195–201  ·  view source on GitHub ↗
(source: str)

Source from the content-addressed store, hash-verified

193################ command-line interface
194
195def run(source: str) -> Any:
196 global_env = Environment({}, standard_env())
197 tokens = tokenize(source)
198 while tokens:
199 exp = read_from_tokens(tokens)
200 result = evaluate(exp, global_env)
201 return result
202
203def main(args: list[str]) -> None:
204 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