any ways to judge whether an object is initilized or not in a class

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Tue Mar 20 13:08:24 EDT 2007


On Tue, 20 Mar 2007 08:27:07 -0700, Alex Martelli wrote:

> You should always use new-style classes in order to avoid having to stop
> and make a decision each time you code a class -- having to stop and ask
> yourself "do I need any of the many extra features of new-style classes
> here, or will legacy classes suffice?" each and every time.

I can sympathize with your argument. I have taught myself to _always_
indicate when turning the car, even when I don't need to. I do it without
thinking, even when turning from my own driveway into my garage (much to
my wife's amusement). And that way, I don't have to think on the road "do
I need to indicate now or not?", I just do it.

Rather than keep arguing my case (life is short...) I'll just mention that
both Fredrik Lundh and Aahz were very dismissive of the suggestion that
people should stop using classic classes back in July 2005.

http://www.thescripts.com/forum/thread25853.html

e.g. Aahz wrote: "There's a big difference between being gung-ho on
new-style classes and telling people to stop using old-style classes."

Have they changed their mind since then? Not that I'm suggesting that
their opinions outweigh Alex's, but I'm not sure that the situation
vis-a-vis classes has changed that much since 2005. If it has, perhaps I
should be revising my opinion too.


-- 
Steven.




More information about the Python-list mailing list