On Wed, Sep 29, 2021 at 8:00 AM Stefan Ram <r...@zedat.fu-berlin.de> wrote: > JSON is a kind of a subset of JavaScript for JavaScript > programmers. In Python, we can use JSON too, or we can > use Python itself. > > When some external requirement to use a data exchange > notation like JSON should appear, one can still "translate" > such Python modules to JSON. This path is not blocked.
JSON exists as a transport mechanism because it is restricted and can't contain malicious code. A Python equivalent would be ast.literal_eval - a strict subset of the language but restricted for safety. For trusted code, yes, straight code can be used. (And ast.literal_eval, unlike JSON, can handle comments.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list