Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a21f55

Browse files
committed
Don’t misuse “package data” in pprint example
1 parent 456ae89 commit 6a21f55

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/pprint.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ Example
192192
-------
193193

194194
To demonstrate several uses of the :func:`pprint` function and its parameters,
195-
let's fetch information about a package from PyPI::
195+
let's fetch information about a project from PyPI::
196196

197197
>>> import json
198198
>>> import pprint
199199
>>> from urllib.request import urlopen
200200
>>> with urlopen('http://pypi.python.org/pypi/configparser/json') as url:
201201
... http_info = url.info()
202202
... raw_data = url.read().decode(http_info.get_content_charset())
203-
>>> package_data = json.loads(raw_data)
204-
>>> result = {'headers': http_info.items(), 'body': package_data}
203+
>>> project_info = json.loads(raw_data)
204+
>>> result = {'headers': http_info.items(), 'body': project_info}
205205

206206
In its basic form, :func:`pprint` shows the whole object::
207207

0 commit comments

Comments
 (0)