diff options
author | Brett Cannon <bcannon@gmail.com> | 2006-03-01 22:10:49 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2006-03-01 22:10:49 (GMT) |
commit | 54ac29497ea7f47852ec6f3ffb2570bbc29ce847 (patch) | |
tree | 561db765a15309bd8a1ec72983e6004f1c8b956c /Doc/tut | |
parent | 65b3dab50e7192b4ad6cae046c3ed15b53752ac4 (diff) | |
download | cpython-54ac29497ea7f47852ec6f3ffb2570bbc29ce847.zip cpython-54ac29497ea7f47852ec6f3ffb2570bbc29ce847.tar.gz cpython-54ac29497ea7f47852ec6f3ffb2570bbc29ce847.tar.bz2 |
Document PEP 352 changes. Also added GeneratorExit.
Diffstat (limited to 'Doc/tut')
-rw-r--r-- | Doc/tut/tut.tex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index e0c54b4..efbc08d 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -3512,6 +3512,12 @@ in \code{instance.args}. For convenience, the exception instance defines \method{__getitem__} and \method{__str__} so the arguments can be accessed or printed directly without having to reference \code{.args}. +But use of \code{.args} is discouraged. Instead, the preferred use is to pass +a single argument to an exception (which can be a tuple if multiple arguments +are needed) and have it bound to the \code{message} attribute. One my also +instantiate an exception first before raising it and add any attributes to it +as desired. + \begin{verbatim} >>> try: ... raise Exception('spam', 'eggs') |