What is the semantics meaning of 'object'?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Jun 24 04:06:45 EDT 2013


On Sun, 23 Jun 2013 21:38:33 -0400, Roy Smith wrote:

> In article <51c7a087$0$29999$c3e8da3$5496439d at news.astraweb.com>,
>  Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> 
>> On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote:
>> 
>> > In article <51c74373$0$29999$c3e8da3$5496439d at news.astraweb.com>,
>> >  Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
>>  
>> >> What else would you call a function that does lookups on the current
>> >> object's superclasses?
>> > 
>> > Well, mro_lookup() would have been a better choice.  Super() has an
>> > obvious meaning, which just happens to be wrong.
>> 
>> This "obvious but wrong" meaning isn't the least bit obvious to me.
>> Care to give me a hint? The only thing I can think of is:
>> 
>> - if you are familiar with single inheritance;
> 
> True.
> 
>> - but unfamiliar with multiple inheritance;
> 
> False.  Although, I'm pretty sure that all the times I've used MI (in
> both Python and C++), it was of the mix-in variety.

Mixins are such a limited version of MI that it's often not even counted 
as MI, and even when it is, being familiar with mixins is hardly 
sufficient to count yourself as familiar with MI. That's kind of like me 
saying I'm familiar with life in Italy on the strength of a three-week 
holiday back in 1982 :-)

If you still think of "the" superclass, then you haven't done enough MI 
to learn better :-)

 
>> - then you might assume that super means "return the superclass of this
>> class" (or possibly instance).
> 
> That's exactly what I assumed.  And, since you correctly surmised that
> that's what I would assume, I would suggest that it was pretty obvious
> to you too.  Of course, given that assumption, it was not at all clear
> what it would do in a class with multiple ancestors.

That's exactly why it *isn't* obvious. Too many assumptions need to be 
made, and questions left unanswered, for the conclusion to be obvious. 
Just because some people might jump to an unjustified conclusion, doesn't 
mean that the conclusion is obvious. That's like saying that it's 
"obvious" that the sun goes around the earth, because that's what it 
looks like. What would it look like if it was the other way around?



>> I don't think that counts as "obvious". Or at least not "intuitive" :-)
> 
> Obvious is in the mind of the observer.

Well that's obvious :-)




-- 
Steven



More information about the Python-list mailing list