Hi,

Hoyt Koepke wrote:
> In iteration over a dictionary, I'm declaring both the variables of
> iteration to have explicit types; i.e. my code is:
> 
> cdef int k
> cdef double v
> 
> for k, v in d.iteritems():
>    # do things
> 
> 
> However, in the c code, I find the following:
> 
>  int __pyx_v_k;
>  double __pyx_v_v;
> ...
>  void *__pyx_t_2;
>  void *__pyx_t_3;
> ...
>    if (!PyDict_Next(__pyx_t_1, (&__pyx_5), ((PyObject**)(&__pyx_t_2)),
> ((PyObject **)(&__pyx_t_3)))) break;
>    __pyx_v_k = ((int)__pyx_t_2);
>    __pyx_v_v = ((double)__pyx_t_3);

Thanks for the report. This was the right thing to do for Python objects,
but not for C types. Should be fixed now.

Stefan

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

Reply via email to