mirror of https://github.com/python/cpython
commit
f8a2865482
|
@ -95,7 +95,7 @@ placeholders unchanged if data is missing::
|
||||||
>>> d = dict(item='unladen swallow')
|
>>> d = dict(item='unladen swallow')
|
||||||
>>> t.substitute(d)
|
>>> t.substitute(d)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
. . .
|
...
|
||||||
KeyError: 'owner'
|
KeyError: 'owner'
|
||||||
>>> t.safe_substitute(d)
|
>>> t.safe_substitute(d)
|
||||||
'Return the unladen swallow to $owner.'
|
'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.error('Error occurred')
|
||||||
logging.critical('Critical error -- shutting down')
|
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
|
WARNING:root:Warning:config file server.conf not found
|
||||||
ERROR:root:Error occurred
|
ERROR:root:Error occurred
|
||||||
|
@ -311,6 +313,8 @@ tree searches::
|
||||||
>>> print("Handling", d.popleft())
|
>>> print("Handling", d.popleft())
|
||||||
Handling task1
|
Handling task1
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
unsearched = deque([starting_node])
|
unsearched = deque([starting_node])
|
||||||
def breadth_first_search(unsearched):
|
def breadth_first_search(unsearched):
|
||||||
node = unsearched.popleft()
|
node = unsearched.popleft()
|
||||||
|
|
Loading…
Reference in New Issue