Is Python overhyped (just like Java)?

Alex Martelli aleax at aleax.it
Tue Apr 1 03:56:38 EST 2003


Steven Taschuk wrote:
   ...
> What do templates have to do with interfaces?

C++ templates, and "interfaces" (entirely abstract classes), are related 
by offering two separate approaches to obtaining polymorphism, with very
different trade-offs. Python polymorphism is very close to the "generic
programming" afforded by C++ templates, since both hinge on signature
based polymorphism.  However, Python's polymorphism is resolved at runtime,
like that based on C++'s virtual-method calls, not at compile-time, like
that afforded by C++'s templates, so the parallels are not exact.


Alex





More information about the Python-list mailing list