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

Antoon Pardon apardon at forel.vub.ac.be
Mon Mar 26 03:43:29 EDT 2007


On 2007-03-20, Alex Martelli <aleax at mac.com> wrote:
> Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> wrote:
>    ...
>> There are plenty of reasons for preferring new style classes. If those
>> reasons hold for you, then of course you should use new style classes.
>> 
>> But that's not the same thing as saying that you should use new style
>> classes *even when you don't care about those features*.
>
> 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.
>
> There should ideally be only one obvious way -- and that obvious way is
> to always use new-style classes and avoid a feature that's there only
> for backwards compatibility with legacy code.

I disagree. The obvious way is to use old-style classes. IMO the obvious
way, is what a newbee will do after he has read the tutorial. And as far
as I am familiar with the tutorial someone trying out python after he
read it, will use old-style classes.

-- 
Antoon Pardon



More information about the Python-list mailing list