Robert Bradshaw | 1 Nov 2007 09:18
Favicon

Re: [Pyrex] C versus Python access

On Oct 31, 2007, at 4:15 PM, Robert Bradshaw wrote:

> On Oct 31, 2007, at 3:37 PM, Greg Ewing wrote:
>
>> More seriously, it looks like it will fail if the overriding
>> method tries to call the inherited method. This will call
>> the wrapper, which will pick up the overriding method and
>> call it again, leading to infinite recursion.
>
> Good point. Short of warning people to avoid this flaw, one could
> maybe look at the traceback to detect where one was called from, or
> perhaps add a dispatcher function (is called by the vtable entry, but
> skipped in the wrapper function). Of course this would add an extra
> function call so is less than ideal... I'll have to think about this;
> do you have any ideas?

Thanks for catching this. I ended up making a global flag that you  
can set right before calling when you want it to skip the dispatching  
code. I could think of only two instances where one would want this:  
in the def wrapper itself and when explicitly doing ClassName.foo 
(self, ...). All works as expected now, and it should still be plenty  
fast.

- Robert

Robert Bradshaw | 1 Nov 2007 11:09
Favicon

Re: More changes

I think Cython 0.9.6.8 is ready for release:

http://www.cython.org/hg/cython-devel/

Robert Bradshaw | 1 Nov 2007 20:03
Favicon

Cython 0.9.6.8 released

Cython 0.9.6.8 is released.

The primary feature of this release is merging in the changes/ 
bugfixed of Pyrex 0.9.6.3. There are numerous other bugfixes  
(including several memory leak and refcount fixes) and rdef has been  
renamed to cpdef (its final name).

Special thanks to Stefan Behnel for doing most the hard initial  
merge, and Carl Witty for hunting down a complicated segfault in  
exception handling, and Michael Abshoff for tracking down memory leaks.

- Robert Bradshaw

Diego | 4 Nov 2007 18:31
Picon

Fwd: while using Cython I got this... any ideas ?

---------- Forwarded message ----------
From: Diego <diegodfreitas@...>
Date: Nov 4, 2007 1:49 PM
Subject: while using Cython I got this... any ideas ?
To: wstein@...

running build
running build_py
running build_ext
cythoning evas/evas.c_evas.pyx to evas/evas.c_evas.c

Error converting Pyrex file to C:
------------------------------------------------------------
...
def render_method_list():
    """Returns a list of render method names.

     <at> rtype: list of str
    """
    cdef Evas_List *lst
                  ^
------------------------------------------------------------

/home/diego/e17/proto/python-efl/python-evas/evas/evas.c_evas.pyx:29:19:
Syntax error in C variable declaration
building 'evas.c_evas' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall
-Wstrict-prototypes -fPIC -Iinclude -I/usr/include/python2.5 -c
evas/evas.c_evas.c -o build/temp.linux-i686-2.5/evas/evas.c_evas.o
gcc: evas/evas.c_evas.c: No such file or directory
(Continue reading)

Stefan Behnel | 5 Nov 2007 15:09
Picon
Favicon

Re: Fwd: while using Cython I got this... any ideas ?


Diego wrote:
> ---------- Forwarded message ----------
> From: Diego <diegodfreitas@...>
> Date: Nov 4, 2007 1:49 PM
> Subject: while using Cython I got this... any ideas ?
> To: wstein@...
> 
> 
> running build
> running build_py
> running build_ext
> cythoning evas/evas.c_evas.pyx to evas/evas.c_evas.c
> 
> Error converting Pyrex file to C:
> ------------------------------------------------------------
> ...
> def render_method_list():
>     """Returns a list of render method names.
> 
>      <at> rtype: list of str
>     """
>     cdef Evas_List *lst
>                   ^
> ------------------------------------------------------------
> 
> /home/diego/e17/proto/python-efl/python-evas/evas/evas.c_evas.pyx:29:19:
> Syntax error in C variable declaration

Looks like "Evas_List" is unknown. It must be declared somewhere to make it
(Continue reading)

Robert Bradshaw | 5 Nov 2007 18:40
Favicon

Re: Fwd: while using Cython I got this... any ideas ?

Is Evas_List declared as a cdef class or type?

On Nov 4, 2007, at 9:31 AM, Diego wrote:

> ---------- Forwarded message ----------
> From: Diego <diegodfreitas@...>
> Date: Nov 4, 2007 1:49 PM
> Subject: while using Cython I got this... any ideas ?
> To: wstein@...
>
>
> running build
> running build_py
> running build_ext
> cythoning evas/evas.c_evas.pyx to evas/evas.c_evas.c
>
> Error converting Pyrex file to C:
> ------------------------------------------------------------
> ...
> def render_method_list():
>     """Returns a list of render method names.
>
>      <at> rtype: list of str
>     """
>     cdef Evas_List *lst
>                   ^
> ------------------------------------------------------------
>
> /home/diego/e17/proto/python-efl/python-evas/evas/evas.c_evas.pyx: 
> 29:19:
(Continue reading)

Robert Bradshaw | 5 Nov 2007 22:39
Favicon

Re: [Pyrex] Cython 0.9.6.8 released

No one working on the SAGE project has had any problems with 10.5 and  
Cython, but we build our own python. Setting it higher might cause  
problems with older OSs.

I've actually never touched that file, perhaps someone else could  
comment...

- Robert

On Nov 3, 2007, at 5:15 PM, Jim McCoy wrote:

> In Cython/Mac/DarwinSystem.py the line:
>
> os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.3"
>
> causes the OS-supplied version of Python on Leopard to choke.  It
> wants 10.5 in this position.
>
> Jim

David McNab | 6 Nov 2007 23:13
Picon
Favicon

C++ wrapping tutorial

Hi all,

I've posted on the wiki a short tutorial on using Pyrex/Cython to wrap
C++ classes:

http://wiki.cython.org/WrappingCPlusPlus

I'd be grateful if folks of greater expertise could look over it and
make changes/improvements as needed.

Cheers
David

Ulisses Furquim | 6 Nov 2007 23:57

Re: Fwd: while using Cython I got this... any ideas ?

On 11/4/07, Diego <diegodfreitas@...> wrote:
> running build
> running build_py
> running build_ext
> cythoning evas/evas.c_evas.pyx to evas/evas.c_evas.c
>
> Error converting Pyrex file to C:
> ------------------------------------------------------------
> ...
> def render_method_list():
>     """Returns a list of render method names.
>
>      <at> rtype: list of str
>     """
>     cdef Evas_List *lst
>                   ^
> ------------------------------------------------------------
>
> /home/diego/e17/proto/python-efl/python-evas/evas/evas.c_evas.pyx:29:19:
> Syntax error in C variable declaration
> building 'evas.c_evas' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall
> -Wstrict-prototypes -fPIC -Iinclude -I/usr/include/python2.5 -c
> evas/evas.c_evas.c -o build/temp.linux-i686-2.5/evas/evas.c_evas.o
> gcc: evas/evas.c_evas.c: No such file or directory
> gcc: no input files
> error: command 'gcc' failed with exit status 1

This error happens when Cython couldn't generate the C source code
file. Can you please update to Cython 0.9.6.8 and try to compile
(Continue reading)

Robert Bradshaw | 7 Nov 2007 00:01
Favicon

Re: Fwd: while using Cython I got this... any ideas ?

On Nov 6, 2007, at 2:57 PM, Ulisses Furquim wrote:

> This error happens when Cython couldn't generate the C source code
> file. Can you please update to Cython 0.9.6.8 and try to compile
> python-efl again? Yesterday I've just changed everything there to work
> with this newer version. If you have any problems, please tell me and
> I'll help you.

Just out of curiosity, what did you have to change to get things to  
work?

- Robert


Gmane