Raymond Hettinger <[email protected]> added the comment:
Here's pure python code for expirmentation:
from marshal import dumps, loads
def marshal_set(s):
return dumps(sorted((dumps(value), value) for value in s))
def unmarshal_set(m):
return {value for dump, value in loads(m)}
def test(s):
assert unmarshal_set(marshal_set(s)) == s
test({("string", 1), ("string", 2), ("string", 3)})
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37596>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com