3 ms·
> Python is a bit more haphazard; the infamous `len(str)`, to wit. There is nothing infamous about it. It's a multimethod, the designers of Python decided tha
by masklinn 16y ago
> Python is a bit more haphazard; the infamous `len(str)`, to wit.
There is nothing infamous about it. It's a multimethod, the designers of Python decided that mandating the same function for everything (via a common protocol under the covers) was better than risking people implementing a thousand different method names. They did the same with the iterator protocol.
- rue 16y agoI think that is a poor argument since the same is not true of every function. Therefore, it feels inconsistent to me, which is the only basis I can make judgments on.
- masklinn 16y ago> I think that is a poor argument since the same is not true of every function What is not true of every function?
- binomial 16y agoI think the GP was referring to "mandating the same function for everything (via a common protocol under the covers) was better than risking people implementing a thousand different method names".