Skip to content

Commit e42e21f

Browse files
committed
Merge pull request #515 from mplewis/improve_json_section
Improve json section
2 parents 48361b5 + f6d503d commit e42e21f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

docs/scenarios/json.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
JSON
22
====
33

4-
The `json <https://docs.python.org/2/library/json.html>`_ library can parse JSON from strings or files. When parsing, the library converts the JSON into a Python dictionary or list. It can also parse Python dictionaries or lists into JSON strings.
4+
The `json <https://docs.python.org/2/library/json.html>`_ library can parse JSON from strings or files. The library parses JSON into a Python dictionary or list. It can also convert Python dictionaries or lists into JSON strings.
55

66
Parsing JSON
77
------------
@@ -26,7 +26,7 @@ and can now be used as a normal dictionary:
2626
print(parsed_json['first_name'])
2727
"Guido"
2828
29-
You can also convert a the following to JSON:
29+
You can also convert the following to JSON:
3030

3131
.. code-block:: python
3232
@@ -43,6 +43,14 @@ You can also convert a the following to JSON:
4343
simplejson
4444
----------
4545

46-
`simplejson <https://simplejson.readthedocs.org/en/latest/>`_ is the externally maintained development version of the json library.
46+
The JSON library was added to Python in version 2.6. If you're using an earlier version of Python, the `simplejson <https://simplejson.readthedocs.org/en/latest/>`_ library is available via PyPI.
4747

48-
simplejson mimics the json standard library, it is available so that developers that use an older version of python can use the latest features available in the json lib.
48+
simplejson mimics the json standard library. It is available so that developers that use older versions of Python can use the latest features available in the json lib.
49+
50+
You can start using simplejson when the json library is not available by importing simplejson under a different name:
51+
52+
.. code-block:: python
53+
54+
import simplejson as json
55+
56+
After importing simplejson as json, the above examples will all work as if you were using the standard json library.

0 commit comments

Comments
 (0)