Definitive documentation on newstyle classes? (WAS: Pickling and inheritance are making me hurt)
Colin J. Williams
cjw at sympatico.ca
Tue Feb 8 12:50:53 EST 2005
Brian van den Broek wrote:
> Daniel Bickett said unto the world upon 2005-02-05 19:46:
>
>> I was reading the "Pickling and inheritance are making me hurt"
>> thread, and the latest suggestion (as of this posting) was to do with
>> the __setstate__ and __getstate__ methods. They caught my attention
>> because I hadn't encountered them before, and it reminded me that in
>> the past I've never been able to very good, definitive documentation
>> on newstyle classes. Googling for it gives little python tutorials on
>> various sites, and even searching this newsgroup returns very specific
>> questions, as a rule.
>>
>> Alas, the question: Does there exist a page that enumerates all of the
>> features of the newstyle classes, and explains what they all do? If
>> so, can anyone provide me with such a link?
>>
>> Thanks :-)
>
>
> Hi Daniel,
>
> it doesn't yet answer the "definitive" part, but
> <http://www.python.org/moin/NewClassVsClassicClass> is worth a look.
>
> Best,
>
> Brian vdB
Yes, that's the best I've come across. But a clearer overall view, tied
in to the Language Reference, would be very helpful.
It would be good to have a clear exposition of the pros and cons of
__new__ usage.
Colin W.
More information about the Python-list
mailing list