Re: [Python-Dev] An interesting exception handling quirk

2013-10-20 Thread Nick Coghlan
On 20 October 2013 16:08, Armin Rigo wrote: > Hi Nick, > > On Sat, Oct 19, 2013 at 1:41 PM, Nick Coghlan wrote: >> recreating the *exact* exception subclass check from >> Python is actually difficult these days. > > Can't it be done roughly like that? > >def __exit__(self, typ, val, tb): >

Re: [Python-Dev] An interesting exception handling quirk

2013-10-19 Thread Armin Rigo
Hi Nick, On Sat, Oct 19, 2013 at 1:41 PM, Nick Coghlan wrote: > recreating the *exact* exception subclass check from > Python is actually difficult these days. Can't it be done roughly like that? def __exit__(self, typ, val, tb): try: raise typ, val except self.ex

Re: [Python-Dev] An interesting exception handling quirk

2013-10-19 Thread Nick Coghlan
On 19 October 2013 22:53, Antoine Pitrou wrote: > On Sat, 19 Oct 2013 21:41:17 +1000 > Nick Coghlan wrote: >> >> Having noticed the discrepancy, I feel like it should be explicitly >> recorded somewhere in the language reference, I'm just not sure where. > > Since it's a quirk, I don't think it s

Re: [Python-Dev] An interesting exception handling quirk

2013-10-19 Thread Antoine Pitrou
On Sat, 19 Oct 2013 21:41:17 +1000 Nick Coghlan wrote: > > Having noticed the discrepancy, I feel like it should be explicitly > recorded somewhere in the language reference, I'm just not sure where. Since it's a quirk, I don't think it should be mentioned in the language reference. Also, see ht