MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / lispstr

Function lispstr

18-with-match/lispy/py3.9/lis.py:127–132  ·  view source on GitHub ↗

Convert a Python object back into a Lisp-readable string.

(exp: object)

Source from the content-addressed store, hash-verified

125 print(lispstr(val))
126
127def lispstr(exp: object) -> str:
128 "Convert a Python object back into a Lisp-readable string."
129 if isinstance(exp, list):
130 return '(' + ' '.join(map(lispstr, exp)) + ')'
131 else:
132 return str(exp)
133
134
135################ Evaluator

Callers 3

standard_envFunction · 0.70
replFunction · 0.70
evaluateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected