Guido rethinking removal of cmp from sort method

Chris Angelico rosuav at gmail.com
Sat Apr 2 07:06:34 CEST 2011


On Sat, Apr 2, 2011 at 3:54 PM, harrismh777 <harrismh777 at charter.net> wrote:
> Terry Reedy wrote:
>>>
>>> When I speak of implementation vs interface I am speaking from a
>>> strictly object oriented philosophy, as pedigree, from Grady Booch, whom
>>> I consider to be the father of Object Oriented Analysis and Design
>>> (Booch, OO A&D with apps, 1994).
>
>>
>> Python is object based but not object oriented in the Booch sense.
>>
>> . . . and Python is not OOA&D based.
>
>    With due respects Terry, these statements you have made are categorically
> not true. Even a casual perusal of the Python supplied documentation and
> helps (documented class interfaces) make it very clear that OOP and OOA&D
> are at the very heart of the design of Python.

Why this lengthy discussion on whether Python is object-oriented or
not? What difference does it make? The "implementation vs interface"
difference has nothing to do with that. If I write a library, and I
export a number of public functions, then updating the library in a
way that breaks programs is a bad thing.

But bad things sometimes have to happen. And that's why things are
versioned. Object oriented
programming/design/analysis/architecture/whatever has no effect on
that; if you link against a library, or call on an object, you need to
be able to depend on it. The interface of "sort([1,2,3,4])" is no
different from "[1,2,3,4].sort()" just because one is objects and the
other is functions.

Maybe we need a new directive:

from __past__ import cmpsort

Chris Angelico



More information about the Python-list mailing list