[issue25683] __context__ for yields inside except clause

2017-11-30 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue25683] __context__ for yields inside except clause

2017-02-17 Thread Nathaniel Smith
Nathaniel Smith added the comment: I disagree with the stated reason for closing this, because in general, implicit context chaining doesn't care about where the exception was instantiated, only where it was raised. For example: - err = ValueError() try: raise KeyError except Exception

[issue25683] __context__ for yields inside except clause

2015-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: I now don't think this is a bug. In the above example, SubError is instantiated outside of `main` generator. It's also thrown *into* `main` from the *outside* scope. And __context__ should be set for exceptions that were originated by the code that was handl

[issue25683] __context__ for yields inside except clause

2015-11-25 Thread Emanuel Barry
Emanuel Barry added the comment: Oops, that was *completely* the wrong issue. I apologize for the noise. -- ___ Python tracker ___ ___

[issue25683] __context__ for yields inside except clause

2015-11-25 Thread Emanuel Barry
Emanuel Barry added the comment: This is due to the fact that Python 3 added the ability to define only __eq__ and get a free __ne__ defined. If my memory serves me right, functools.total_ordering was added in 3.2 and then backported to 2.x - where the relationship with __eq__ and __ne__ is no

[issue25683] __context__ for yields inside except clause

2015-11-20 Thread Yury Selivanov
New submission from Yury Selivanov: In the below snippet, SubError will propagate with __context__ set to None, instead of MainError. Maybe this isn't a bug? class MainError(Exception): pass class SubError(Exception): pass def main(): try: raise MainError()