durusmail: durus-users: Durus Change Preview
Durus Change Preview
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-25
2006-10-31
2006-10-31
Durus Change Preview
David Binger
2006-10-25
On Oct 25, 2006, at 3:14 PM, Mike Orr wrote:

> ...__getstate__ exists in Python to support pickling and the copy
> module. No other Python package I know of uses .__getstate__ as a
> substitute for .__dict__ or vars().  The logical alternative is:
>    dict((x, getattr(obj, x)) for x in obj.__slots__)
> though I suppose we can mention .__getstate__ as an alternative that
> happens to work.

No.
This does not work unless all of the data slots are declared on this
class.
They may also be named on superclasses.


reply