Variable inheritance
Oleg Broytmann
phd at phd.fep.ru
Tue May 22 07:10:42 EDT 2001
On Tue, 22 May 2001, Alex Martelli wrote:
> > But grey mouse DOES NOT "contains" grey color. The mouse IS really grey
> > thing, hence I used inheritance.
>
> Not a good example IMHO. This is a typical misuse of 'IS', the
> kind that got Korzibsky to rant justifiedly against 'the IS of
> identity'. Good examples are those where something *BEHAVES*
> in a certain way. _Behavior_ is chiefly what you want to use
> inheritance for
But of course! For the sake of brevity I skipped all behavioral code,
but of course ColorThings have methods, so if one defines GreyMouse s/he's
got behavior of both Mouse (as an Animal) and Grey (as a ColorThing).
Oleg.
----
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-list
mailing list