summaryrefslogtreecommitdiff
path: root/requests
diff options
context:
space:
mode:
authorlzutao <taolzu@gmail.com>2019-09-17 19:34:36 +0700
committerGitHub <noreply@github.com>2019-09-17 19:34:36 +0700
commit39b3dcf7d937570f8a5ecda57ac0aae7eeea3aba (patch)
treec5af87bb2ee1603b2ba822ccb0da6aaf874f39f8 /requests
parent3d968ff34dd9945f2a86396001408ba69c1ab3fd (diff)
downloadpython-requests-39b3dcf7d937570f8a5ecda57ac0aae7eeea3aba.tar.gz
Fix formatting of status code example
Diffstat (limited to 'requests')
-rw-r--r--requests/status_codes.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/requests/status_codes.py b/requests/status_codes.py
index 4e99ad73..d80a7cd4 100644
--- a/requests/status_codes.py
+++ b/requests/status_codes.py
@@ -4,13 +4,16 @@ r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
->>> import requests
->>> requests.codes['temporary_redirect']
-307
->>> requests.codes.teapot
-418
->>> requests.codes['\o/']
-200
+
+Example::
+
+ >>> import requests
+ >>> requests.codes['temporary_redirect']
+ 307
+ >>> requests.codes.teapot
+ 418
+ >>> requests.codes['\o/']
+ 200
Some codes have multiple names, and both upper- and lower-case versions of
the names are allowed. For example, ``codes.ok``, ``codes.OK``, and