Open GoogleCodeExporter opened 9 years ago
Enclosed is an attachment that should fix this issue.
Original comment by billy.earney@gmail.com
on 9 Feb 2013 at 7:06
Attachments:
Thanks for the report and the proposed implementation by Bill
It's fine for me, but I am going to post a message on the forum to see if all
agree on local_storage using JSON transparently, or if we should let it store
strings and ask the programmer to explicitely "stringify" and "parse" using JSON
Anyway, with this issue in mind, I recently added a built-in module json.js
that implements these functions :
import json
x = json.stringify([1,2])
print(json.parse(x))
You can test it in the console on the Brython site
Original comment by pierre.q...@gmail.com
on 17 Feb 2013 at 9:04
Bill, Pierre thanks for the answers, Bill solution is nice but only works for
lists (it doesn't work for strings). The built-in json.js seems nice but it
isn't capable of deserializing dicts, for example. I think local_storage should
be transparent so it could be more reliable.
Original comment by j...@jsantos.eu
on 18 Feb 2013 at 8:36
Original issue reported on code.google.com by
j...@jsantos.eu
on 4 Feb 2013 at 5:32