Advertisement
Guest User

Untitled

a guest
May 25th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. >>> import json
  2. >>> a = []
  3. >>> a.append(a)
  4. >>> json.dumps(a)
  5. Traceback (most recent call last):
  6. File "<stdin>", line 1, in <module>
  7. File "/usr/lib/python3.6/json/__init__.py", line 231, in dumps
  8. return _default_encoder.encode(obj)
  9. File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
  10. chunks = self.iterencode(o, _one_shot=True)
  11. File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
  12. return _iterencode(o, 0)
  13. ValueError: Circular reference detected
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement