OO in Python? ^^

Antoon Pardon apardon at forel.vub.ac.be
Thu Dec 15 06:50:18 EST 2005


Op 2005-12-15, Ben Sizer schreef <kylotan at gmail.com>:
>
> Antoon Pardon wrote:
>> Op 2005-12-14, Christopher Subich schreef
>> > Doesn't work; duck typing is emphatically not subclass-typing.
>>
>> I don't see how that is relevant.
>>
>> > For this
>> > system to still work and be as general as Python is now (without having
>> > to make all variables 'object's),
>>
>> But the way Guido wants python to evolve would make all variables
>> objects. This is what PEP 3000 states.
>>
>>   Support only new-style classes; classic classes will be gone.
>>
>> As far as I understand this would imply that all classes are subclasses
>> of object and thus that isinstance(var, object) would be true for all variables.
>
> But that's still useless for your purposes.

What purpose would that be? Maybe you can tell me, so I can
know too.

> Everything will be derived from object but it doesn't mean
> everything file-like will be derived from file or everything
> dictionary-like will be derived from dictionary.

So? I answered a question. That my answer is not usefull for
a specific purpose is very well prosible but is AFAIC irrelevant.
I didn't notice a specific purpose behind the question
and didn't answer the question with a specific purpose in mind.

> Duck-typing means that code told to 'expect' certain types
> will break unnecessarily when a different-yet-equivalent type is later
> passed to it.

I think you mixed things up.

-- 
Antoon Pardon



More information about the Python-list mailing list