what's the difference between python objects and json objects?

后端 未结 2 978
无人共我
无人共我 2020-12-30 09:17

On the surface it appears that python uses json natively. The only exception I can think of is the fact that json can store js functions.

Here\'s my issue: I need t

2条回答
  •  抹茶落季
    2020-12-30 09:51

    JSON does not have objects per se, and cannot store JavaScript functions. Its syntax may appear similar to JavaScript literals, but trying to use it as such all the time will cause nothing but pain.

    And there should be no need to use eval(); both JavaScript and Python have JSON parsers and serializers readily available.

提交回复
热议问题