summaryrefslogtreecommitdiffstats
path: root/Doc/library/json.rst
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2013-08-10 20:01:45 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2013-08-10 20:01:45 (GMT)
commita4998a70416c27730e75c0a4225ee2c3552b1618 (patch)
tree5f04a47e0c77fdc0d0e05ff4a09d9a3e3c42702e /Doc/library/json.rst
parentfbcf4d78c881176345483111503c4bc7765d4ff8 (diff)
downloadcpython-a4998a70416c27730e75c0a4225ee2c3552b1618.zip
cpython-a4998a70416c27730e75c0a4225ee2c3552b1618.tar.gz
cpython-a4998a70416c27730e75c0a4225ee2c3552b1618.tar.bz2
Close #18264: int- and float-derived enums now converted to int or float.
Diffstat (limited to 'Doc/library/json.rst')
-rw-r--r--Doc/library/json.rst37
1 files changed, 20 insertions, 17 deletions
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index faa7ac9..68aef21 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -349,23 +349,26 @@ Encoders and Decoders
.. _py-to-json-table:
- +-------------------+---------------+
- | Python | JSON |
- +===================+===============+
- | dict | object |
- +-------------------+---------------+
- | list, tuple | array |
- +-------------------+---------------+
- | str | string |
- +-------------------+---------------+
- | int, float | number |
- +-------------------+---------------+
- | True | true |
- +-------------------+---------------+
- | False | false |
- +-------------------+---------------+
- | None | null |
- +-------------------+---------------+
+ +----------------------------------------+---------------+
+ | Python | JSON |
+ +========================================+===============+
+ | dict | object |
+ +----------------------------------------+---------------+
+ | list, tuple | array |
+ +----------------------------------------+---------------+
+ | str | string |
+ +----------------------------------------+---------------+
+ | int, float, int- & float-derived Enums | number |
+ +----------------------------------------+---------------+
+ | True | true |
+ +----------------------------------------+---------------+
+ | False | false |
+ +----------------------------------------+---------------+
+ | None | null |
+ +----------------------------------------+---------------+
+
+ .. versionchanged:: 3.4
+ Added support for int- and float-derived Enum classes.
To extend this to recognize other objects, subclass and implement a
:meth:`default` method with another method that returns a serializable object