homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients Arfrever, Tyler.Crompton, ethan.furman, ncoghlan
Date 2012年06月27日.22:27:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <4FEB8BE1.1060509@stoneleaf.us>
In-reply-to <CADiSq7f=pjYCxxbkvjO8V7UPaMA1D7JeR_jucwpexJS2BQ2xWQ@mail.gmail.com>
Content
Nick Coghlan wrote:
> The from clause is intended for replacing previous exceptions with *new*
> exceptions, not editing the attributes of existing ones which may already
> have a different __cause__ set.
Huh. While I agree with the doc patch solution, I think the most common 
use of 'from' will be 'raise SomeException from None' or, as the patch 
suggests, 'raise exc from None' (exc being an already existing exception).
Any examples of when somebody might do:
try:
 do_something()
except NameError:
 raise NewError from SomeOtherError
?
I am unsure of the advantages in replacing NameError in the above stack 
trace with SomeOtherError instead... although NameError would still be 
there in __context__...
Still, any examples?
~Ethan~
History
Date User Action Args
2012年06月27日 22:27:45ethan.furmansetrecipients: + ethan.furman, ncoghlan, Arfrever, Tyler.Crompton
2012年06月27日 22:27:45ethan.furmanlinkissue15209 messages
2012年06月27日 22:27:44ethan.furmancreate

AltStyle によって変換されたページ (->オリジナル) /