Re: [Cython] Exception instantiation

2012-03-21 Thread Robert Bradshaw
On Wed, Mar 21, 2012 at 1:03 AM, Stefan Behnel wrote: > Hi, > > I was made aware of a difference between the ways Cython and CPython raise > exceptions. In CPython, the exception is always instantiated immediately, > even if you raise a plain type, i.e. > >    raise TypeError > > will actually rai

Re: [Cython] Exception instantiation

2012-03-21 Thread Lisandro Dalcin
On 21 March 2012 11:03, Stefan Behnel wrote: > Hi, > I think this should change. We may consider leaving it as it is for known > exception types that are created without arguments, +1 > but otherwise, and > especially for user provided exceptions, we should take the safer route of > always insta

[Cython] Exception instantiation

2012-03-21 Thread Stefan Behnel
Hi, I was made aware of a difference between the ways Cython and CPython raise exceptions. In CPython, the exception is always instantiated immediately, even if you raise a plain type, i.e. raise TypeError will actually raise a TypeError() instance. In Cython, the exception is only stored, n