Guido rethinking removal of cmp from sort method

Chris Angelico rosuav at gmail.com
Sat Apr 2 02:17:43 EDT 2011


On Sat, Apr 2, 2011 at 4:17 PM, harrismh777 <harrismh777 at charter.net> wrote:
> Chris Angelico wrote:
>>
>> Why this lengthy discussion on whether Python is object-oriented or
>> not? What difference does it make?
>
>     Great question... glad you asked...!
>
>> But bad things sometimes have to happen. And that's why things are
>> versioned.
>
>     You didn't read the post... cmp removal is a bad thing, and it does not
> need to,  and should not have to  happen.

I agree that removal of a feature like that is a bad thing. But the
whole point of this thread is the question of whether or not it should
have happened (or rather, whether or not it should be undone).

>    Wrong... one of the reasons for OOP in the first place ( OOA&D ) is to
> ensure that BAD THINGS DO NOT HAPPEN.  Code reuse and stability are key...
> and OOA&D helps to make sure that works.

So it's perfectly acceptable for bad things to happen in a
non-object-oriented library, but as soon as it works with objects, it
has to eschew badness? This does not make sense.

>    You need to read Grady Booch... and study a little OOP design either
> using SmallTalk, or C++, to get an appreciation maybe for what is at stake
> here.

I've been a C++ programmer for nearly twenty years. I think I know a
few things about OOP. Actually, I've done OOP in non-OO languages;
most notably, plain old C. The OS/2 Presentation Manager class
hierarchy (SOM) is primarily implemented in C, for instance. My point
is that "object orientation" is completely separate from
"implementation is separate from interface".

>     You may not have enough knowledge to understand what I'm talking about.
>  Forgive me.

Maybe I don't. Let me check my character sheet...

Skill, Ranks, Ability, Total modifier
Knowledge (Arcana): 19 + 4 = 23
Knowledge (History): 11 + 4 = 15
Knowledge (Nature): 2 + 4 = 6
Knowledge (The Planes): 0

Not sure where Knowledge (OOP) comes in there. Must ask my DM some day.

Seriously though: I've programmed various systems, where the division
of "interface" and "implementation" come in quite different places; my
favorite being networking, where the interface is the comms protocol,
and everything else is implementation. Objects don't come into it.

But this is getting seriously off-topic; none of this connects with
the cmp= parameter.

Chris Angelico



More information about the Python-list mailing list