Posts: 4,647
Threads: 1,494
Joined: Sep 2016
is jsonpickle directly compatible with JavaScript? can loading jsonpickle restore all the Python objects it dumps to the same exact thing they were before?
my goal with PYON is serialize to a format that can be inserted in Python source code or use other means of parsing Python source like eval() or exec() ... and ... have improved human readability (one example is that it sorts dictionary keys ... an implementation thing).
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
there are data types Python has that JavaScript does not have. if jsonpickle supports those types then it is not fully compatible with JavaScript. maybe it is putting pickle format in a string and putting that string in JSON? i have no idea if JavaScript supports control characters or the whole 0..127 or 0..255 range of character values. i think PYON is the way to go for Python compatibility unless you also need JavaScript compatibility.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
types like boolean. decimal.Decimal. complex.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,647
Threads: 1,494
Joined: Sep 2016
i have read that many things cannot handle cyclic references. i have not done that in my PYON code. i do intend to add some code to detect such cycles and avoid them, but i have not worked out ways to represent and reconstruct cycles.
that does look like a different way of defining types that is not inherintly JSON strung out inside JSON. so i would not call it JSON. it's not Python, either. it can't be fully utilized in either JavaScript or Python without something to decode it. OTOH, PYON is fully Python (except for cycles), leaving it up to other languages to develop their own tools for it, if it becomes popular enough. my implementation is still not done. i need to add a few things after i redo it all as a generator or coroutine. then dump output would just wrap around the generator.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.