Hi,

thanks for the report.

Marc Christiansen wrote:
> I'm not sure if multiple assignment is the right name, but have a look
> at this code:
> 
> cdef f1():
>     cdef char a, b
> 
>     a = b = False
> 
> Cython 0.9.8 creates this:
> 
> [...]
>  *
>  *     a = b = False             # <<<<<<<<<<<<<<
>  */
>   __pyx_1 = __pyx_PyInt_char(Py_False); if (unlikely((__pyx_1 == (char)-1) && 
> PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; 
> __pyx_clineno = __LINE__; goto __pyx_L1;}
>   __pyx_v_a = __pyx_1;
>   __pyx_1 = __pyx_PyInt_char(Py_False); if (unlikely((__pyx_1 == (char)-1) && 
> PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; 
> __pyx_clineno = __LINE__; goto __pyx_L1;}
>   __pyx_v_b = __pyx_1;
> 
> [...]
> 
> If I write a = b = 0 (or a = False; b = False), the result is the expected
>   __pyx_v_a = 0;
>   __pyx_v_b = 0;

This is not really a problem, more of a missing optimisation for a case that's
handled differently internally. It sounds like it could go away with Dag's
work on the assignment handling anyway. Dag?

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to