Hi,

The following code (also attached as a .pyx file) fails in the current
Cython :

cdef class test:
    pass

def main():
    cdef test a, b, c, d
    (a, b) = (c, d) = (None, None)

When run, I get the following traceback:

In [1]: import assign_test
In [2]: assign_test.main()
Traceback (most recent call last):
  File "<ipython-input-2-c2f7599d7b34>", line 1, in <module>
    assign_test.main()
  File "assign_test.pyx", line 6, in assign_test.main (assign_test.c:669)
    (a, b) = (c, d) = (None, None)
TypeError: Cannot convert NoneType to assign_test.test

I am using the latest Cython development version (from github).  Also
tested with Cython 0.18.

$ git rev-parse HEAD
e8bd1789905a58d8224e4be5019be401f360aa54

I don't get an error when I change the assignments to either:

(a, b) = (None, None)

or

a = b = None

Is this a bug in Cython?  I tried doing a git bisect and it seems like
commit ea6a71acb5c79afb080855be1cb6ca30d283ec25 is when the above code
started failing (It works with the previous commit).

Thanks,
Alok

Attachment: assign_test.pyx
Description: Binary data

_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to