SV: Python Productivity over C++

Garry Hodgson garry at sage.att.com
Thu Jun 15 14:43:05 EDT 2000


David Bolen wrote:
> 
> hzhu at knowledgetrack.com (Huaiyu Zhu) writes:
> 
> > Now only if somebody could enhance that to check inherited methods too (the
> > "more general case").  That is, if a method is not found, go recursively
> > into the superclasses.  The following example is not correct at the moment:
> 
> Ah, good point - try this variant - I switched to getattr() which
> takes the inheritance into account (you could also write your own
> recursive function that used Instance.__bases__ to look in the
> superclasses).

this message, and the others in this mini-thread, point out
what is, to me, the real power of a language like python
vs. something like c++.  thomas complained about a problem
where all interface methods might not be implemented, and
how it could bite you down the road.  a legitimate concern,
though one that, for many, is not important.

david (and others) quickly whipped up a mechanism to answer
this need.  i can use it where it matters, or ignore it where
it doesn't.  my choice.

i am always impressed with python, and this newsgroup, when 
someone points out a "missing" feature, and others show how
to implement it within the existing language.  this is the
real power of the language, and a large part of why it remains
simple.  you don't need to add features to the core language
when you can just implement them in terms of it instead.  this
is a large part of the attraction of scheme, as well (at least
for me).

reminds me of the old X slogan, "mechanism, no policy".

-- 
Garry Hodgson                   Every night 
garry at sage.att.com                a child is born
Software Innovation Services        is a Holy Night.
AT&T Labs                         - Sophia Lyon Fahs



More information about the Python-list mailing list