[issue37891] Exceptions tutorial page does not mention raise from

2021-05-14 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for looking. This issue does appear to be out of date.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2021-05-14 Thread Bonifacio


Bonifacio  added the comment:

Version 3.9 of the docs already cover the syntax Neils talks about in his 
original message. 
https://docs.python.org/3.9/tutorial/errors.html#exception-chaining
Is there anything left to be done here? If so, I'm glad to help with them, but 
I would need directions.

--
nosy: +Bonifacio2

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2021-03-21 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
versions: +Python 3.10 -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-09-05 Thread Niels Albers


Niels Albers  added the comment:

Thanks Srinivas for the suggestion. IMO exception chaining has more utility 
than only dealing with new exceptions that are caused by exception handling. 
It's all about preserving exception context. As both a writer of libraries and 
a user of such, I do like to have a full context chain when I have to handle an 
exception (or more importantly as a devops engineeer: log it)

Is this edit acceptable?

"If you need to track exception context, you can use exception chaining. You 
can chain exceptions by using the ``from`` clause. Just raise a new exception 
class or instance from an existing exception. The existing exception will be 
set as 
the cause for the new exception."

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-09-04 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

Here is my first pass at this. I propose the following sentence be added at the 
end section 8.4:

If you need to track related exceptions (exceptions during exception handling), 
you should use exception chaining. You can chain exceptions by using the 
``from`` clause. Just raise a new exception class or instance from an existing 
exception. The existing exception will be set as 
the cause for the new exception.

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Please give Niel a chance to submit wording, even a post here on the tracker 
will be fine.  We usually defer to the person who actually encountered the 
issue.  

If after a week or so, there is no response, you can pick this up.  Try to be 
minimal with it and avoid the temptation to go gonzo.  The "from" part of 
exception semantics is one of its most minor and easily ignored features.  
Accordingly, it should get minimal space in the tutorial and probably doesn't 
even warrant an example if a simple, clear sentence will suffice.

--

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Srinivas Nyayapati


Srinivas Nyayapati  added the comment:

In case Niels Albers is not interested, can I submit a PR?
I noticed the linked raise reference documentation from the tutorial having 
details on exception chaining 
(https://docs.python.org/3.7/reference/simple_stmts.html#raise). Does it make 
sense to mention exception chaining in the tutorial and say "read details in 
the reference docs"? Or as you mentioned.. just write a short paragraph on 
exception chaining and give an example in the tutorial?

--
nosy: +shireenrao

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for spotting this omission.  Would you like to submit a PR with a short 
paragraph on exception chaining and "raise from"?

--
nosy: +rhettinger

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Niels Albers


Change by Niels Albers :


--
type:  -> enhancement

___
Python tracker 

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



[issue37891] Exceptions tutorial page does not mention raise from

2019-08-20 Thread Niels Albers


New submission from Niels Albers :

raise  from  has been in the language since 
python 3, yet the tutorial page teaching about exceptions does not mention it. 
(see https://docs.python.org/3.7/tutorial/errors.html#raising-exceptions)
It would be especially helpful to language newcomers to touch on the 
possibility of passing error context when raising a new exception in an 
exception handler.

--
assignee: docs@python
components: Documentation
messages: 349994
nosy: Niels Albers, docs@python
priority: normal
severity: normal
status: open
title: Exceptions tutorial page does not mention raise from
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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