From anonymous, 6 Months ago, written in Python.
Embed
  1. Python 3.4.6 (default, Feb  4 2017, 12:11:10)
  2. [GCC 6.3.1 20170109] on linux
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> import json
  5. >>> json.dumps(reversed([1, 2]))
  6. Traceback (most recent call last):
  7.   File "<stdin>", line 1, in <module>
  8.   File "/usr/lib/python3.4/json/__init__.py", line 230, in dumps
  9.     return _default_encoder.encode(obj)
  10.   File "/usr/lib/python3.4/json/encoder.py", line 192, in encode
  11.     chunks = self.iterencode(o, _one_shot=True)
  12.   File "/usr/lib/python3.4/json/encoder.py", line 250, in iterencode
  13.     return _iterencode(o, 0)
  14.   File "/usr/lib/python3.4/json/encoder.py", line 173, in default
  15.     raise TypeError(repr(o) + " is not JSON serializable")
  16. TypeError: <list_reverseiterator object at 0x7f3cf4eb7c18> is not JSON serializable
  17. >>> json.dumps(list(reversed([1, 2])))
  18. '[2, 1]'
  19.