Message296243
WeakSet contains the __reduce__ method, but it isn't pickleable (and never was), because the pickle state contains the value of the __dict__ dict attribute which contains a reference to unpickleable local function _remove().
>>> pickle.dumps(weakref.WeakSet())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: Can't pickle local object 'WeakSet.__init__.<locals>._remove'
I wondering whether WeakSet should be made pickleable or the __reduce__ method should be removed. __reduce__() can be used also for copying, but there are no tests for this feature. |
|
Date |
User |
Action |
Args |
2017-06-17 18:54:10 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, twouters, georg.brandl, rhettinger, pitrou |
2017-06-17 18:54:10 | serhiy.storchaka | set | messageid: <1497725650.32.0.990416022712.issue30691@psf.upfronthosting.co.za> |
2017-06-17 18:54:10 | serhiy.storchaka | link | issue30691 messages |
2017-06-17 18:54:09 | serhiy.storchaka | create | |
|