Mike Graham wrote:
Since there isn't really any magic going on, why use a __foo__ name? The majority of __foo__ names are for things you shouldn't reference yourself
To my mind, the main reason is to avoid name clashes. Protocol methods often may need to be added to just about any class, and using a __foo__ name greatly reduces the chance of it coinciding with some pre-existing class-specific method.
Anyway, you don't call it yourself in this case either -- it's called by the proposed json-serialising framework.