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

Function lispstr

18-with-match/lispy/original/lis.py:101–106  ·  view source on GitHub ↗

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

(exp)

Source from the content-addressed store, hash-verified

99 print(lispstr(val))
100
101def lispstr(exp):
102 "Convert a Python object back into a Lisp-readable string."
103 if isinstance(exp, List):
104 return '(' + ' '.join(map(lispstr, exp)) + ')'
105 else:
106 return str(exp)
107
108################ eval
109

Callers 2

testFunction · 0.70
replFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56