29 Jul
2010
29 Jul
'10
2:27 p.m.
On Thu, Jul 29, 2010 at 4:14 PM, Alexandre Conrad <alexandre.conrad@gmail.com> wrote:
2010/7/29 Tarek Ziadé <ziade.tarek@gmail.com>:
On Thu, Jul 29, 2010 at 3:51 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
Le jeudi 29 juillet 2010 à 15:47 +0200, Tarek Ziadé a écrit :
On Thu, Jul 29, 2010 at 3:42 PM, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
And I don't see how `__json__` is more annoying than e.g. `to_json`.
Its easier to override
Could you expand a little bit?
If you want to override to_json in a subclass, to slightly adapt it, its easier because the __json__ name is mangled by Python
I believe that mangling will not be performed if the identifier ends with more than one underscore. So __json__ won't be mangled.
Ooops I forgot about that :)