[Python-ideas] Improving the expressivity of function annotations
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Apr 4 23:49:47 CEST 2011
Michael Foord wrote:
>
> Generics are a hack within the language syntax to tell the
> compiler that different types *might* be used (and allow you to refer to
> these types in your implementation without knowing what they will be),
> whereas a smarter compiler could deduce this for itself anyway.
You seem to be conflating the idea of generic types, aka
parametric types, with the particular syntax used to express
them in certain languages. Some of the syntaxes do seem
rather hackish, particularly in C++. But I don't think the
concept itself is hackish at all.
--
Greg
More information about the Python-ideas
mailing list