3 ms·
> In simple terms, only 2.5% of call sites in most programs can't be handled by name-based typing with single inheritance. Adding parametric polymorphism (i.e.,
by catnaroek 10y ago
> In simple terms, only 2.5% of call sites in most programs can't be handled by name-based typing with single inheritance. Adding parametric polymorphism (i.e., generics) only makes half a percent of difference, and most of the remaining cases can't be handled by widely-used mechanisms.
If parametric polymorphism only helps with 0.5% of all call sites, then probably:
(0) You're relying too much on implementation details across module boundaries. This destroys opportunities for type abstraction.
(1) You're unwittingly repeating the same logic over and over for multiple types. Not likely the case in Python.
(2) You're relying too much on unenforced conventions.