
Feb. 18, 2014
7:46 p.m.
18.02.14 20:16, Ethan Furman написав(ла):
This conversation wasn't in the PEP, but as I recall we decided to go with value instead of name for json because the receiving end may not be running Python.
Is having json do it one way and pickle another a problem?
We decided to go with value instead of name for JSON because JSON doesn't support enums, but supports integers and strings, and because enums are comparable with they values, but not with they names.
json.loads(json.dumps(socket.AF_INET)) == socket.AF_INET True
We simply had no other choice.