On Tue, Sep 18, 2018, 10:12 AM Jeroen Demeyer <J.Demeyer@ugent.be> wrote:
On 2018-09-17 15:44, Robert Bradshaw wrote:
> One of the pain points in Cython is that one must explicitly annotate
> non-object returning functions with except clauses. Would it be worth
> trying to change the default here, making exception-suppressing opt-in
> rather than opt-out?

Just to clarify things: are you proposing that the default would be
"except *"?

We may choose an implicit default exception value.

An alternative would be to give *warnings* for functions where
exceptions could occur but could not be propagated. For example, this
function is totally fine:

cdef int foo(int x):
     return x

but this function would give a warning:

cdef int foo(x):
     return x   # implicit conversion Python -> int

Given that essentially every Python operation can raise exceptions, I don't know how useful this warning would be. Unless we expect everyone to change their code.

and this should probably be a compile-time error:

cdef int foo(x):
     raise NotImplementedError

_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel