Simon Burton | 12 Aug 17:53

[Cython] cython regression ?


$ cython foo.pyx 

Error converting Pyrex file to C:
------------------------------------------------------------
...

cdef class Foo:

    public unsigned int zap
          ^
------------------------------------------------------------

foo.pyx:5:11: Syntax error in simple statement list

$ cython --version
Cython version 0.9.8

Or did I break my cython install ?

Simon.
Robert Bradshaw | 12 Aug 21:28

Re: [Cython] cython regression ?

On Aug 12, 2008, at 8:53 AM, Simon Burton wrote:

> $ cython foo.pyx
>
> Error converting Pyrex file to C:
> ------------------------------------------------------------
> ...
>
>
> cdef class Foo:
>
>     public unsigned int zap
>           ^
> ------------------------------------------------------------
>
> foo.pyx:5:11: Syntax error in simple statement list
>
> $ cython --version
> Cython version 0.9.8
>
>
> Or did I break my cython install ?

Don't you have to write

cdef class Foo:
     cdef public unsigned int zap

?

(Continue reading)

Simon Burton | 12 Aug 21:35

Re: [Cython] cython regression ?

On Tue, 12 Aug 2008 12:28:40 -0700
Robert Bradshaw <robertwb@...> wrote:

> On Aug 12, 2008, at 8:53 AM, Simon Burton wrote:
> 
> > $ cython foo.pyx
> >
> > Error converting Pyrex file to C:
> > ------------------------------------------------------------
> > ...
> >
> >
> > cdef class Foo:
> >
> >     public unsigned int zap
> >           ^
> > ------------------------------------------------------------
> >
> > foo.pyx:5:11: Syntax error in simple statement list
> >
> > $ cython --version
> > Cython version 0.9.8
> >
> >
> > Or did I break my cython install ?
> 
> Don't you have to write
> 
> cdef class Foo:
>      cdef public unsigned int zap
(Continue reading)

Stefan Behnel | 12 Aug 21:43

Re: [Cython] cython regression ?

Hi,

Simon Burton wrote:
> On Tue, 12 Aug 2008 12:28:40 -0700
> Robert Bradshaw <robertwb@...> wrote:
> 
>> On Aug 12, 2008, at 8:53 AM, Simon Burton wrote:
>>> $ cython foo.pyx
>>> Error converting Pyrex file to C:
>>> cdef class Foo:
>>>     public unsigned int zap
>>> foo.pyx:5:11: Syntax error in simple statement list
>>>
>> Don't you have to write
>>
>> cdef class Foo:
>>      cdef public unsigned int zap
> 
> Yes apparently so.
> However, this was working in Cython version 0.9.6.12

Then I'm happy we fixed that bug already. :)

Stefan

Simon Burton | 13 Aug 19:01

Re: [Cython] cython regression ?

On Tue, 12 Aug 2008 21:43:49 +0200
Stefan Behnel <stefan_ml@...> wrote:

> 
> Then I'm happy we fixed that bug already. :)
> 
> Stefan

OK, but i'm finding some more regressions in my code.

Here is a buffer class that compiles fine:

cdef class Buffer:

    cdef public char * data

    def __cinit__(self):

        self.data = NULL

But when i separate the definition into a pxd file i get this:

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef class Buffer:

    def __cinit__(self):

        self.data = NULL
(Continue reading)

Simon Burton | 13 Aug 19:53

Re: [Cython] cython regression ?

On Wed, 13 Aug 2008 13:01:23 -0400
Simon Burton <simon@...> wrote:

> 
> If I do an strace, it seems cython does not find the pxd:
> 
> stat64(".../zap/zap.foo.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)
> stat64(".../zap/zap/foo.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)
> stat64(".../zap/zap/foo/__init__.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)

It seems to be the presence of .../zap/__init__.py that triggers this behaviour.

Simon.
Robert Bradshaw | 13 Aug 21:14

Re: [Cython] cython regression ?

On Wed, 13 Aug 2008, Simon Burton wrote:

> On Wed, 13 Aug 2008 13:01:23 -0400
> Simon Burton <simon@...> wrote:
>
>>
>> If I do an strace, it seems cython does not find the pxd:
>>
>> stat64(".../zap/zap.foo.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)
>> stat64(".../zap/zap/foo.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)
>> stat64(".../zap/zap/foo/__init__.pxd", 0xbfc81ee8) = -1 ENOENT (No such file or directory)
>
> It seems to be the presence of .../zap/__init__.py that triggers this behaviour.
>
> Simon.

Just to confirm, your directory structure is

zap/
     __init__.py
     foo.pyx
     foo.pxd

Or are you doing something else?

- Robert

Simon Burton | 13 Aug 22:12

Re: [Cython] cython regression ?

On Wed, 13 Aug 2008 12:14:00 -0700 (PDT)
Robert Bradshaw <robertwb@...> wrote:

> 
> Just to confirm, your directory structure is
> 
> zap/
>      __init__.py
>      foo.pyx
>      foo.pxd
> 
> Or are you doing something else?
> 
> - Robert

That's correct.

Simon.

Gmane