[Python-ideas] Json object-level serializer

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jul 30 02:06:18 CEST 2010

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.


More information about the Python-ideas mailing list