Cython + tuple unpacking

Hugues Salamin hugues.salamin at
Thu Apr 23 16:06:45 CEST 2009


The following code will crash with a segfault when compiled using cython (v0.11)

def func():
    for (a, b) ,c ,d in zip(zip(range(3), range(3)), range(3), range(3)):
        print a, b
        print c
        print d # This line segfault

Compilation is done using distutils.

If the module is imported in python and func is called, I got a segmentation
fault at the line "print d".

I investigated the error with valgrind and gdb but I still have no clue what is
going on.

I'm on Ubuntu 8.04, Kernel 2.6.24-22-generic

Hugues Salamin

More information about the Python-list mailing list