[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Bob Ippolito
Bob Ippolito added the comment: The documentation says "If specified, default is a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError." *can't otherwise be serialized* means that the object mus

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Pierre Hanser
Pierre Hanser added the comment: you realize that the current handling is incorrect and also not documented? and that the described case is from the real world: it prevents using pydbus and dbus.Boolean type to send a json boolean I don't take your argument about performance: i would like to h

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Bob Ippolito
Bob Ippolito added the comment: It is common to specify a default function but it would be terrible for performance if this function was called for every single object passed through to the decoder. If you want a serialization different from a primitive type you'll have to choose a differen

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> bob.ippolito nosy: +bob.ippolito ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue5535] json custom encoder not fully functionnal

2009-03-22 Thread Pierre Hanser
New submission from Pierre Hanser : The json module provides an encoder python -> json. The encoding may be specialized by the user, using the cls parameter of the dumps function. But all simple types are always handled by the library encoder, the user encoder is only used as a last resort one,