On Thu, 29 Jul 2010 22:51:11 +1000 Nick Coghlan email@example.com wrote:
Each individual time this question comes up people tend to react with "oh, that's too complicated and overkill, but magic methods are simple, so let's just define another magic method". The sum total of all those magic methods starts to accumulate into a lot of complexity of its own though :P
I don't agree. __json__ only matters to people who do JSON encoding/decoding. Other people can safely ignore it.
And I don't see how generic functions bring less cognitive overhead. (they actually bring more of it, since most implementations are more complicated to begin with)