summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-11-06 19:23:02 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-11-06 19:23:02 (GMT)
commitfcdc80bfd25cae437dcc28ebc9240b0e49efc5aa (patch)
tree6e009190891d7cba602e1772f93c93b393b96e7b /Doc/tutorial
parenta8bb5506a6b6d17d28c969a159dd587f2a96052c (diff)
downloadcpython-fcdc80bfd25cae437dcc28ebc9240b0e49efc5aa.zip
cpython-fcdc80bfd25cae437dcc28ebc9240b0e49efc5aa.tar.gz
cpython-fcdc80bfd25cae437dcc28ebc9240b0e49efc5aa.tar.bz2
Fix grammar error; reword two paragraphs
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/controlflow.rst20
1 files changed, 11 insertions, 9 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst
index 481867a..809afc1 100644
--- a/Doc/tutorial/controlflow.rst
+++ b/Doc/tutorial/controlflow.rst
@@ -166,8 +166,8 @@ required syntactically but the program requires no action. For example::
... pass # Busy-wait for keyboard interrupt (Ctrl+C)
...
-This is commonly used for creating minimal classes like with exceptions, or
-for skipping unwanted exceptions::
+This is commonly used for creating minimal classes such as exceptions, or
+for ignoring unwanted exceptions::
>>> class ParserError(Exception):
... pass
@@ -178,7 +178,7 @@ for skipping unwanted exceptions::
... pass
...
-Another place it can be used is as a place-holder for a function or
+Another place :keyword:`pass` can be used is as a place-holder for a function or
conditional body when you are working on new code, allowing you to keep
thinking at a more abstract level. However, as :keyword:`pass` is silently
ignored, a better choice may be to raise a :exc:`NotImplementedError`
@@ -193,12 +193,14 @@ exception::
If :keyword:`pass` were used here and you later ran tests, they may fail
without indicating why. Using :exc:`NotImplementedError` causes this code
-to raise an exception, allowing you to tell exactly where code that you
-need to complete is. Note the two call styles of the exceptions above.
-The comment style is useful in that when you remove the exception you can
-easily leave the comment, which ideally would be a good description for
-the block of code the exception is a placeholder for. The call-style
-will raise a more useful exception however.
+to raise an exception, telling you exactly where the incomplete code
+is. Note the two calling styles of the exceptions above.
+The first style, with no message but with an accompanying comment,
+lets you easily leave the comment when you remove the exception,
+which ideally would be a good description for
+the block of code the exception is a placeholder for. However, the
+third example, providing a message for the exception, will produce
+a more useful traceback.
.. _tut-functions: