[issue41576] document BaseException in favour of bare except in error tutorial

2021-08-06 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Thomas! ✨  ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2021-08-06 Thread miss-islington


miss-islington  added the comment:


New changeset 699ee016af5736ffc80f68359617611a22b72943 by Miss Islington (bot) 
in branch '3.10':
bpo-41576: document BaseException in favor of bare except (GH-21917)
https://github.com/python/cpython/commit/699ee016af5736ffc80f68359617611a22b72943


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2021-08-06 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy:  -erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2021-08-06 Thread miss-islington


Change by miss-islington :


--
keywords: +patch
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +26140
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27646

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2021-08-06 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e9a6f1b78bf57d9f3f99547bd007d7cfc9724cfb by Thomas Grainger in 
branch 'main':
bpo-41576: document BaseException in favor of bare except (GH-21917)
https://github.com/python/cpython/commit/e9a6f1b78bf57d9f3f99547bd007d7cfc9724cfb


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2021-07-05 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Serhiy/Terry: Is further discussion needed? Can this be closed, or should the 
proposed PR be applied (after resolving any issues)?

--
nosy: +erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-22 Thread Thomas Grainger


Thomas Grainger  added the comment:

The purpose of this tutorial section is to document how to catch all types of 
exceptions and extract the type and value. When this is required, 
`BaseException as err:` is the preferred approach.

This document still mentions the alternative approach so that readers will know 
what it means when they encounter it, and know to upgrade it to the py2.4+ 
syntax

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a tutorial. The purpose of this part is documenting the bare except 
clause. It cannot be done without using a bare except in example.

There is nothing wrong with a bare except if it used properly (e.g. if the 
caught exception is reraised). In any case "except BaseException" is not any 
better, because it is equivalent to a bare except.

Note also that PR 21917 introduces an error: instead of printing the type of 
exception it prints the stringified exception itself (in some case it is an 
empty string).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

PEP 8 discourages the use of bare except.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-18 Thread Thomas Grainger


Thomas Grainger  added the comment:

it seems odd to document digging around in sys.exc_info() in favour of the more 
ergonomic syntax to do the same thing

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

What a problem do you try to solve? What is wrong with the current 
documentation?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41576] document BaseException in favour of bare except in error tutorial

2020-08-18 Thread Thomas Grainger


Change by Thomas Grainger :


--
assignee: docs@python
components: Documentation
nosy: docs@python, graingert
priority: normal
pull_requests: 21033
severity: normal
status: open
title: document BaseException in favour of bare except in error tutorial

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com