[Cython] a = b = (cdef) cval

Lisandro Dalcin dalcinl at gmail.com
Sat Apr 12 01:58:50 CEST 2008


It seems the code generated by

cdef MyClass cval = MyClass()

a = b = cval

is not equivalent in semantics to Python, 'a is b' should be true.

I acctually did this

cdef int cval = 10
a = b = cval

then 'a is b'  is true, because of the internal Python cache for small integers.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the Cython-dev mailing list