News for hackers. Stuff that matters.
Re:OO in Python is mostly pointless by davidwf on Wednesday January 27, 2021 @06:28PM (#25935631)
I am not a language expert, but Clojure (inspired by CLOS IIRC) does method resolution based on an arbitrary function that can ask any "is it a duck?" question of the arguments:

https://clojure.org/about/runtime_polymorphism

It's common for code to "choose" which method to call based on the class of the arguments, but it's also common to choose which method based on whether a particular key is in the hashmap, etc.

Re:OO in Python is mostly pointless by mumblemumble on Wednesday January 27, 2021 @06:32PM (#25935667)
I suppose that this is edging dangerously close to starting a semantic argument, but I'd personally argue that ad-hoc polymorphism is a distinct concept from duck typing that just happens to have a lot of overlap in its use cases. One key distinction is that Clojure multimethods need to be explicitly declared somewhere, whereas duck typing is 100% implicit.
Re:OO in Python is mostly pointless by fulafel on Thursday January 28, 2021 @12:59AM (#25938738)
And in everyday Clojure usage the equivalent of Python attribute access is key access on maps, which is even more directly duck typed.