Author serhiy.storchaka
Recipients georg.brandl, gvanrossum, larry, ncoghlan, oconnor663, pitrou, serhiy.storchaka, vstinner, yselivanov
Date 2015-12-02.20:39:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449088793.33.0.766065863355.issue25782@psf.upfronthosting.co.za>
In-reply-to
Content
> What to do when you try to chain "C -> C"?

Nothing. Or may be raise an exception (because C.__context__ can't be set to what you try).

> you expected one type of exception, then you used some external library, and after that you have a completely different exception.

I don't understand what new can add the reordering. It doesn't change original exception, it only changes __context__, but you change it in any case. If silently ignore the loop, you would get __context__ different from what you expected. If raise TypeError, you would get TypeError instead of expected exception.

And if the decision will be to raise TypeError, may be RuntimeError is more appropriate?
History
Date User Action Args
2015-12-02 20:39:53serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, georg.brandl, ncoghlan, pitrou, vstinner, larry, yselivanov, oconnor663
2015-12-02 20:39:53serhiy.storchakasetmessageid: <1449088793.33.0.766065863355.issue25782@psf.upfronthosting.co.za>
2015-12-02 20:39:53serhiy.storchakalinkissue25782 messages
2015-12-02 20:39:53serhiy.storchakacreate