[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-11 Thread Éric Araujo
Changes by Éric Araujo : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-11 Thread Éric Araujo
Éric Araujo added the comment: Nice, thanks! -- resolution: fixed -> stage: committed/rejected -> patch review status: closed -> open ___ Python tracker ___

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-11 Thread R. David Murray
R. David Murray 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: -> fixed stage: patch revie

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-10 Thread R. David Murray
R. David Murray 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 EnvironmentError, and also impr

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-07 Thread Éric Araujo
Éric Araujo added the comment: It would. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-07 Thread R. David Murray
R. David Murray 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)." --

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-07 Thread Éric Araujo
Éric Araujo 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 googling find this.

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-09-07 Thread R. David Murray
R. David Murray 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 specific, since it assumes t

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-08-20 Thread Terry J. Reedy
Terry J. Reedy 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 called both 'best'

[issue9608] Re-phrase best way of using exceptions in doanddont.rst

2010-08-15 Thread Floris Bruynooghe
New submission from Floris Bruynooghe : 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 the best and not the very la