R. David Murray rdmur...@bitdance.com added the comment:
Committed in r84719 and r84720, backported to 2.7 in r84721 with the addition
of a sentence admitting that sometimes you need a bare except to catch
third-party exceptions that don't inherit from Exception.
--
resolution: -
Éric Araujo mer...@netwok.org added the comment:
Nice, thanks!
--
resolution: fixed -
stage: committed/rejected - patch review
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9608
Changes by Éric Araujo mer...@netwok.org:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9608
___
R. David Murray rdmur...@bitdance.com added the comment:
Here is another edit pass, incorporating Éric's suggestions and adding some
additional tweaks. In particular, I eliminated the anti-pattern of catching
(IOError, OSError) in one of the earlier examples in favor of the correct
R. David Murray rdmur...@bitdance.com added the comment:
Here is a more extensive rewrite that I think makes things clearer and (I hope)
makes the text read better. I also updated the preceding section per the
confusion expressed in issue 8518.
Note that this patch is somewhat Python3
Éric Araujo mer...@netwok.org added the comment:
Your rewrite makes the text much clearer in my opinion. Here are some nits for
you to grind, cheers :)
1) I’d say “using a bare ``except:``” and maybe add an index entry for “bare
except” referring to that section, to make indexing and maybe
R. David Murray rdmur...@bitdance.com added the comment:
(1) and (2) are good ideas. For (3), would it be clear enough if it read
``except:`` catches *all* exceptions, [...] and GeneratorExit (which is not an
error and should not normally be caught by user code).
--
Éric Araujo mer...@netwok.org added the comment:
It would.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9608
___
___
Python-bugs-list mailing
Terry J. Reedy tjre...@udel.edu added the comment:
Doc/howto/doanddont.rst is the source for
Python HOWTOs: Idioms and Anti-Idioms in Python
Moshe Zadka original author (added as nosy)
The gist of the patch is to clarify that using 'with' is best, not the non-with
version that is currently
New submission from Floris Bruynooghe floris.bruynoo...@gmail.com:
The description of how to best use exceptions is slightly confusing and led me
to believe there was an issue when using open() as a context manager. The main
issue is that the wording seems to suggest the example above it is
10 matches
Mail list logo