Re:Python 3.4.0 released
by bcoates on Monday March 17, 2014 @12:49PM
(#7416216)
If I understand the PEP right, this explanation is missing the part where it's only useful to extend abstract classes; python classes are open so you can just add a method to a concrete class to get single-dispatch if that's all you need. I don't think the example given needs generics at all.
[ Parent
| on HN ]
>python classes are open so you can just add a method to a concrete class to get single-dispatch if that's all you need.
Except then your method shares a namespace with all the other methods defined on the class, which is ugly, and can cause clashes.