What single-dispatch generic functions mean for you
lukasz.langa.pl
lukasz.langa.pl
And arguably, they're not powerful enough either.
This is a sort of pretty common stuff, imho. Not some crown jewel Python has snatched from a unique language that was the only one to implement it.
I use Python since ~1999, and had a chance to observe how the language has imported a number of approaches from other languages, usually to a great benefit of its users. This is one more step. Note how it does not introduce a single bit of new syntax or backward incompatibility, btw.
Rich Hickey's pretty open about the fact that there's very few original ideas in Clojure. When he presented the new reader/EDN features of Clojure 1.4, someone in the crowd told him it was very similar to YAML. He said "I didn't know that, I ripped it off Erlang, but I'm sure other people have had the same idea." (words to that effect)
# You can only dispatch on the class of all arguments. # You can't prefer one method over another. # You've got to use the Python class hierarchy.
I suspect the last one is the real killer: you can't detangle yourself from Python classes, and it doesn't interact well with the Python class system. Idiomatic Clojure code, on the other hand, treats classes as a necessary evil in extremely limited circumstances and allows you to construct arbitrary hierarchies.
All of which is insight that helps explain to me why the Python implementation looks so limited to me. Language design is hard, especially when you're popular.
Language design is a formal discipline. Why the urge to dumb it down?
That's a joke, son.
--F. Leghorn
It also illustrates the danger for authors of leading with a joke at someone else's expense. All that effort to carefully explain the ideas, why they are valuable, and how they can be used gets collapsed into a religious dispute over type safety.If only Python supported multi-line lambdas...