[Python-checkins] cpython (3.4): Add prompts to interactive example.

zach.ware python-checkins at python.org
Tue May 6 16:21:57 CEST 2014


http://hg.python.org/cpython/rev/b4b10afd2fe6
changeset:   90571:b4b10afd2fe6
branch:      3.4
parent:      90568:faaa8d569664
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Tue May 06 09:18:17 2014 -0500
summary:
  Add prompts to interactive example.

This makes it match the new example below, and allows Sphinx's
"hide the prompts and output" feature to work.

files:
  Doc/reference/compound_stmts.rst |  16 ++++++++--------
  1 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -313,14 +313,14 @@
 If the :keyword:`finally` clause executes a :keyword:`return` or :keyword:`break`
 statement, the saved exception is discarded::
 
-    def f():
-        try:
-            1/0
-        finally:
-            return 42
-
-    >>> f()
-    42
+   >>> def f():
+   ...     try:
+   ...         1/0
+   ...     finally:
+   ...         return 42
+   ...
+   >>> f()
+   42
 
 The exception information is not available to the program during execution of
 the :keyword:`finally` clause.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list