diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-05-05 20:21:38 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-05-05 20:21:38 (GMT) |
commit | 4b964f9c904744b7d7d88054e54a2e4ca8aeb395 (patch) | |
tree | c24ba51492fc3fc714c54f2e671f21172d063908 /Doc/whatsnew | |
parent | 5f2e0e5ccb988cdf65137034b33ee57198cc23b9 (diff) | |
download | cpython-4b964f9c904744b7d7d88054e54a2e4ca8aeb395.zip cpython-4b964f9c904744b7d7d88054e54a2e4ca8aeb395.tar.gz cpython-4b964f9c904744b7d7d88054e54a2e4ca8aeb395.tar.bz2 |
Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Ippolito.
Closes issue #2750.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/2.6.rst | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst index 03bd432..17493e7 100644 --- a/Doc/whatsnew/2.6.rst +++ b/Doc/whatsnew/2.6.rst @@ -1210,6 +1210,7 @@ Mullender that was in Python's :file:`Demo/classes/` directory for a long time. This implementation was significantly updated by Jeffrey Yasskin. + Other Language Changes ====================== @@ -2146,6 +2147,31 @@ complete list of changes, or look through the CVS logs for all the details. .. ====================================================================== .. whole new modules get described in subsections here +The :mod:`json` module +---------------------- + +The new :mod:`json` module supports the encoding and decoding of Python types in +JSON (Javascript Object Notation). JSON is a lightweight interchange format +often used in web applications. For more information about JSON, see +http://www.json.org. + +:mod:`json` comes with support for decoding and encoding most builtin Python +types. The following example encodes and decodes a dictionary:: + + >>> import json + >>> data = {"spam" : "foo", "parrot" : 42} + >>> in_json = json.dumps(data) # Encode the data + >>> in_json + '{"parrot": 42, "spam": "foo"}' + >>> json.loads(in_json) # Decode into a Python object + {"spam" : "foo", "parrot" : 42} + +It is also possible to write your own decoders and encoders to support more +types. Pretty-printing of the JSON strings is also supported. + +:mod:`json` (originally called simplejson) was written by Bob Ippolito. + + Improved SSL Support -------------------------------------------------- |