Re: [sage-devel] Re: exceptions, Python, Cython, C

2011-03-07 Thread Robert Bradshaw
That would do it :). This is why we need automatic .h -> .pxd declarations. Also, it's been thrown around a couple of times that it may be worth making "cdef foo()" a warning, forcing the user to explicitly declare "cdef object foo()" (or, in your case, "cdef int foo() :-). On Mon, Mar 7, 2011 at

Re: [sage-devel] Re: exceptions, Python, Cython, C

2011-02-25 Thread Robert Bradshaw
On Fri, Feb 25, 2011 at 8:07 AM, Jason Grout wrote: > On 2/24/11 11:35 PM, Robert Bradshaw wrote: >> >> On Thu, Feb 24, 2011 at 8:52 PM, Robert Miller >>  wrote: >>> >>> I'm working on wrapping a C package in Cython for use in Sage, and I'm >>> having some trouble. I think the problem has to do wi

Re: [sage-devel] Re: exceptions, Python, Cython, C

2011-02-25 Thread Robert Bradshaw
On Fri, Feb 25, 2011 at 1:07 AM, Tom Boothby wrote: > FWIW, I get that error message on the following: > > sage: cython(""" > cdef int foo(int z) except -1: >    return z > > def bar(z): >    return foo(z) > """) > sage: bar(-1) > ---

Re: [sage-devel] Re: exceptions, Python, Cython, C

2011-02-25 Thread Tom Boothby
FWIW, I get that error message on the following: sage: cython(""" cdef int foo(int z) except -1: return z def bar(z): return foo(z) """) sage: bar(-1) --- SystemError Traceback (most rece