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
The problem: I had a C function declared as "int foo()" but was
importing it in Cython as "cdef foo()". Thus when foo returned 0,
Cython thought this was a NULL pointer and raised the error above.
Thanks for the help, everyone.
--
To post to this group, send an email to sage-devel@googlegroups.c
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
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 with the fact that
the C program uses stderr to report issues. When the pro
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)
> ---
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
On Feb 24, 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 with the fact that
> the C program uses stderr to report issues. When the program exits, I
> get the following message:
>
> SystemE