OO in Python (was Re: Migrating to perl?)

Alex Martelli aleaxit at yahoo.com
Fri Jan 5 10:02:49 EST 2001


"Cameron Laird" <claird at starbase.neosoft.com> wrote in message
news:3284C8A2D218D5A4.904FDBE7634A2E21.13E03F073E968847 at lp.airnews.net...
    [snip]
> >I don't think there is a really good "OO theory" text that does
> >not make some reasonably strong assumptions on the object model
    [snip]
> Does *Object-Oriented Software Construction*
> not make your "cut-off", Alex?

It's a really good book.  It also leans heavily on strong
assumptions on the object-model: compile-time static typing,
multiple-inheritance, classes, no multimethods (dispatching
only on the one object that 'receives the message'), etc.

Some of the assumptions fit in well with Python (mi, classes,
no multimethods), others go very much against its grain (no
compile-time static typing).


> Hmm; perhaps your examples answer my question.
> I'll counter, though, that even single-inheri-
> ted Python is quite a wonderful thing.

If one subscribes to this view, then maybe Liu's "Smalltalk,
Objects, and Design" may be suitable -- it was several years
ago that I read it, and my memory of it is not very sharp,
but, as I recall, it _was_ a really good book (some Smalltalk
orientation, of course; but if one can take deep differences
such as single vs multiple inheritance in stride, then a few
syntax-sugar issues &c might not matter all that much).

Instance data in Smalltalk are never visible outside the
object instance, so the OO style you'll learn from this is
going to be somewhat heavy with accessor/mutator methods.
But I guess that's all right, as long as one keeps it in
mind that this approach may not be optimal in Python.


Alex






More information about the Python-list mailing list