loose methods: Smalltalk asPython

Carl Banks pavlovevidence at gmail.com
Wed Dec 27 18:01:32 EST 2006


Jan Theodore Galkowski wrote:
> > We've not had
> > an excellent dynamic OO language since Smalltalk, IMO.

I would say that "excellence" in object oriented programming is not a
strong design goal of Python.  Python tries to support OOP well, but
not to enhance OOP to the detriment of other, more important goals.

[snip]
> >Guido was opposed to modifying builtin types before Java existed.  It's
> >similar to his opposition to dynamic syntax.
>
> Opposition or not, the language definition is there.  Surely Smalltalk's
> OO style can be respected.  Smalltalkers have been doing OO in a dynamic
> context longer than many.  There are things to learn there.

Well, that Smalltalk and Ruby do this at least suggests that it won't
be the end of the world as we know it if it were to happen in Python.
Personally, I'm with Guido here.  Allowing this might make Python's OOP
more "excellent", but it would be to the detriment of other, more
important goals, like minimizing surprise.

> There are two things here that need to be kept straight, I think.
>
> One is the primacy of builtin types.
>
> The other is placing those builtins at the top of their own object
> hierarchy.  Is "int", properly speaking, a descendent of "object"?  No,
> it's the root of its own tree.

Are you saying that it shouldn't be a descendant of "object", or that
it isn't?  "int" is certainly a subclass of "object" in Python (as are
all objects).

> Smalltalk has "int" as well, as a
> *subclass* of Number.  It's primitive.

Number is primitive?  I thought all types in Smalltalk had a common
base type.

Anyways, Python 3000 is exploring the idea of an abstract hierarchy
that has classes (interfaces?) like Number and Sequence.  In fact, I
even saw some talk about somehow being able to retrofit classes to
support one of these interfaces/ABCs, though it was pretty conjectural.

> In any case, as respectful of Mr/Dr van Rossum as I am, simply because
> so-and-so says something is bad and therefore it must be true is a
> fallacious response.

The same could be said of Smalltalk, i.e., because Smalltalk does it
therefore it is good is just as fallacious.

Regardless, whatever Guido pronounces is what happens.  If he's
adamantly against something, it's pretty much an academic discussion.


Carl Banks




More information about the Python-list mailing list