Removing [methods from] a superclass?

Adrian Eyre a.eyre at optichrome.com
Wed Feb 2 12:54:01 EST 2000


> It's not his inheritance model; he is trying to reuse code, isn't he?

Indeed. But in a confusing way. In what sense is a "string" thought of
as a "list". IIRC Python already has a vague object hierarchy (even
though it is written in C not C++):

Object
     +- Sequence
     |         +- List
     |         +- Tuple
     |         +- String
     +- Mapping
     |        +- Dictionary
     +- Number
             +- Integer
             +- Long integer

> He shouldn't have to rewrite the system libraries to have a system class
> inherit from a user defined class.

Maybe this indicates the system libraries need reworking. The UserXxxx
classes are only a temporary fix until the point when Python finally
loses the type/class distinction.

> In his book Framing Software Reuse, Paul Bassett introduces the notion
> of "frames", which complement traditional OO programming.  A frame has
> the ability to add, *delete*, select, modify, and iterate the default
> properties of other frames. Bassett believes that deletion of properties
> is integral to successful reuse in the real world.

Perhaps. But I can well see this idea more open to abuse. Deciding class
roles/inheritences is always tricky, but seeing as Python already has
this defined to a certain extent, it seems odd not to use it.

> Heck, even Eiffel, seemingly language of choice of the Object Gestapo
> ;-) lets you undefine features (albeit with some restrictions).

Never played with it. Nor Smalltalk. Python does just about everything
I need in a language. :)

-----------------------------------------------------------------
Adrian Eyre <a.eyre at optichrome.com> - http://www.optichrome.com 





More information about the Python-list mailing list