diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-09-24 14:31:37 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-09-24 14:31:37 (GMT) |
commit | f8a2865482088b10f3230ece00421bad6e2337f2 (patch) | |
tree | b61a9e3d6188f0b7b20c2a28816da55043d9d89c /Doc/tutorial | |
parent | 5799a2d8c3c57b131004a948fca6af3e42547cf6 (diff) | |
parent | 8618fb6a65435338d88c9f7e18fff000aacb4ec0 (diff) | |
download | cpython-f8a2865482088b10f3230ece00421bad6e2337f2.zip cpython-f8a2865482088b10f3230ece00421bad6e2337f2.tar.gz cpython-f8a2865482088b10f3230ece00421bad6e2337f2.tar.bz2 |
#16019, #16020: merge with 3.2.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/stdlib2.rst | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index 85c88dc..6a48984 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst @@ -95,7 +95,7 @@ placeholders unchanged if data is missing:: >>> d = dict(item='unladen swallow') >>> t.substitute(d) Traceback (most recent call last): - . . . + ... KeyError: 'owner' >>> t.safe_substitute(d) 'Return the unladen swallow to $owner.' @@ -220,7 +220,9 @@ At its simplest, log messages are sent to a file or to ``sys.stderr``:: logging.error('Error occurred') logging.critical('Critical error -- shutting down') -This produces the following output:: +This produces the following output: + +.. code-block:: none WARNING:root:Warning:config file server.conf not found ERROR:root:Error occurred @@ -311,6 +313,8 @@ tree searches:: >>> print("Handling", d.popleft()) Handling task1 +:: + unsearched = deque([starting_node]) def breadth_first_search(unsearched): node = unsearched.popleft() |