diff options
author | Éric Araujo <merwok@netwok.org> | 2011-05-29 01:46:31 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-05-29 01:46:31 (GMT) |
commit | 6a21f5527cab884e2d7dd4db025b5f9a7bd48dd9 (patch) | |
tree | ece77fdd73b4230c78e5c39166566fd1e4e20c24 /Doc | |
parent | 456ae893d7a0b40a5346cbba7771127aca2113e9 (diff) | |
download | cpython-6a21f5527cab884e2d7dd4db025b5f9a7bd48dd9.zip cpython-6a21f5527cab884e2d7dd4db025b5f9a7bd48dd9.tar.gz cpython-6a21f5527cab884e2d7dd4db025b5f9a7bd48dd9.tar.bz2 |
Don’t misuse “package data” in pprint example
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pprint.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index 7bebd8c..4169b64 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -192,7 +192,7 @@ Example ------- To demonstrate several uses of the :func:`pprint` function and its parameters, -let's fetch information about a package from PyPI:: +let's fetch information about a project from PyPI:: >>> import json >>> import pprint @@ -200,8 +200,8 @@ let's fetch information about a package from PyPI:: >>> with urlopen('http://pypi.python.org/pypi/configparser/json') as url: ... http_info = url.info() ... raw_data = url.read().decode(http_info.get_content_charset()) - >>> package_data = json.loads(raw_data) - >>> result = {'headers': http_info.items(), 'body': package_data} + >>> project_info = json.loads(raw_data) + >>> result = {'headers': http_info.items(), 'body': project_info} In its basic form, :func:`pprint` shows the whole object:: |