Message83962
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, for unknown types.
This is not described nor intuitive, and it prevents specifying a custom
encoder for classes which inherit from simple type.
in the provided example (thanks Raymond) a user defined boolean
type, inheriting from int, is handled as int where you would prefer
it to be handled as a json boolean through a custom encoder.
problem seen on simplejson-2.0.9 or official python 2.6.1 |
|
Date |
User |
Action |
Args |
2009-03-22 08:03:40 | phanser | set | recipients:
+ phanser |
2009-03-22 08:03:40 | phanser | set | messageid: <1237709020.89.0.211179227863.issue5535@psf.upfronthosting.co.za> |
2009-03-22 08:03:38 | phanser | link | issue5535 messages |
2009-03-22 08:03:38 | phanser | create | |
|