Python's "only one way to do it" philosophy isn't good?

Neil Cerutti horpner at
Sun Jun 17 14:05:52 CEST 2007

On 2007-06-17, Paul Rubin <http> wrote:
> Neil Cerutti <horpner at> writes:
>> I don't know that much about ML. I know is does a really nice job
>> of generic containers, as does C++. But can it 'foo' any type as
>> easily as C++?
>> template <class T> T foo(T);
> I don't know enough C++ to understand what the above means
> exactly, 

It means that foo can take an object of any type, T,  as a
parameter, and returns an object of type T. 

> but I think the answer is approximately "yes".  I actually
> don't know ML either, so I'm thinking in terms of Haskell types
> which are similar.

The following academic paper seems to be exactly what we're
looking for:

   A comparitive study of language support for generic programming

According to the paper, ML have a similar level of support for
generic programming, though in C++ three of the eight features
must be provided in code with template meta-programming.

Neil Cerutti

More information about the Python-list mailing list