Greg Ewing wrote:
> Stefan Behnel wrote:
>
>> I also wonder how exception subtyping is handled for Python versions
>> before 2.5. I assume this is left to the user, so that
>>
>> cdef class MyExc(Exception): pass
>>
>> will require Py2.5+, whereas
>>
>> class MyExc(Exception): pass
>>
>> should still work in Py2.3.
>
> Yes. Do you think it can/should be handled differently?
No, that's what I expected. Cython doesn't currently handle exception types
any special, so it's not a problem here (unless users declare the exception
types themselves).
I think the behaviour of Pyrex makes sense here. After all, it's a user's
decision if speed is more important than backwards portability for exceptions.
I would expect a compile error in that case, though, like Cython does in a
couple of other cases. Something like a conditional
"""
#if PY_VERSION_HEX < 0x0205000000
#error This module requires new style exceptions, which are only \
available in Python 2.5 or later.
#endif
"""
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev