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 zseil
Recipients
Date 2006-04-01.01:37:23
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=1326842

The problem is that __reduce__() and __reduce_ex__()
have complete control over the process of pickling.

The simple solution would be to switch to the
__getnewargs__() method for pickle protocol 2
(this is simple, __getnewargs__() should
return a tuple which is passed to the constructor
when unpickling. This means that you can reuse the
part of the current code that creates the args tuple)

For protocols 0 and 1, the following should be added
to the copy_reg module:

def pickle_set(s):
    return set, list(s)

pickle(set, pickle_set, set)

def pickle_frozenset(s):
    return frozenset, list(s)

pickle(set, pickle_set, set)


The other options are:
 - copy the semantics from object_reduce_ex
 - add support directly to pickle and cPickle
History
Date User Action Args
2007-08-23 14:35:27adminlinkissue1326448 messages
2007-08-23 14:35:27admincreate