12 Jun
2003
12 Jun
'03
1:48 p.m.
Sylvain Thénault wrote:
do you mean that __setstate__ should never be overriden
There are incredibly few situations where it's a good idea to override __setstate__...
I used __setstate__ to build a non persistent attribute from some persistent data in my object.
I'd suggest using ComptuedAttributes or Python 2.2's 'properties' instead...
I've discussed with Lennart Regebro about my problem and I've finished by putting all my setstate code in a method which should be called instead of directly access to the attribute, so the attribute is built on the first call.
That's not how __setstate__ works ;-) cheers, Chris