Message108937
Empty sets are pickled as set([]). The pickle contains serialization of an empty list that is passed to set constructor during unpickling:
>>> dis(dumps(set()))
0: \x80 PROTO 3
2: c GLOBAL 'builtins set'
16: q BINPUT 0
18: ] EMPTY_LIST
19: q BINPUT 1
21: \x85 TUPLE1
22: q BINPUT 2
24: R REDUCE
25: q BINPUT 3
27: . STOP
The proposed patch pickles empty set as set() instead:
>>> dis(dumps(set()))
0: \x80 PROTO 3
2: c GLOBAL 'builtins set'
16: q BINPUT 0
18: ) EMPTY_TUPLE
19: R REDUCE
20: q BINPUT 1
22: . STOP |
|
Date |
User |
Action |
Args |
2010-06-29 19:28:40 | belopolsky | set | recipients:
+ belopolsky, pitrou, alexandre.vassalotti |
2010-06-29 19:28:40 | belopolsky | set | messageid: <1277839720.0.0.346517516652.issue9120@psf.upfronthosting.co.za> |
2010-06-29 19:28:38 | belopolsky | link | issue9120 messages |
2010-06-29 19:28:38 | belopolsky | create | |
|