Is Python overhyped (just like Java)?

Greg Ewing (using news.cis.dfn.de) ckea25d02 at sneakemail.com
Tue Apr 1 19:31:31 EST 2003


Thomas Bellman wrote:
> It says that
> the motivation was for container classes, but IMHO that's
> essentially the same problem: you want to use types/classes with
> different inheritance in the same functions or data structures,
> as long as the interface is the same.

No, it's not the same problem, when you're dealing with a
static type system. Getting stuff *into* the collection is
only half the story. The real problem is that when you
get something *out* of the collection, you want the compiler
to know statically that it's of whatever type the collection
is supposed to contain.

Interfaces don't help you with that at all -- you need a
notion of parameterized types, which is what C++ templates
are.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg





More information about the Python-list mailing list