This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients georg.brandl, pitrou, rhettinger, serhiy.storchaka, twouters
Date 2017-06-17.18:54:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497725650.32.0.990416022712.issue30691@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-06-17 18:54:10serhiy.storchakasetrecipients: + serhiy.storchaka, twouters, georg.brandl, rhettinger, pitrou
2017-06-17 18:54:10serhiy.storchakasetmessageid: <1497725650.32.0.990416022712.issue30691@psf.upfronthosting.co.za>
2017-06-17 18:54:10serhiy.storchakalinkissue30691 messages
2017-06-17 18:54:09serhiy.storchakacreate