Revision fd0351ae
ID | fd0351aef246f5d36e641209429e2ec093d325f8 |
Parent | 9869e771 |
Child | cdeda3b6 |
serializer: Fail if dictionary uses invalid keys
JSON only supports a very restricted set of types for dictionary keys,
among them strings, booleans and “null”. Integers and floats are
converted to strings. Since this can cause a lot of confusion in Python,
this check raises an exception if a caller tries to use such types.
Since the pre-Python 2.6 “simplejson” module doesn't support overriding
the function where the conversion takes place this check can only be
done for the newer “json” module.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Files
- added
- modified
- copied
- renamed
- deleted