To create a temp of the right type for an expression, one can do a

code.funcstate.allocate_temp(self.bound2.type, manage_ref=False), where
self.bound2 is the expresssion?

Also is there an irc channel for cython?

Another question that I had in mind is, when would ForInStatNode and
ForFromStatNode be used?  My understanding was that the former would be used
in case of "for in" and the latter would be used in case of "for from"
loops.

But

cdef int g():
     print "g called"
     return 5

def f():
    cdef int i
    for i in range(g()):
        print i
    print i

uses a ForFromStatNode for the "for in" loop!

On Wed, Mar 18, 2009 at 2:44 PM, Dag Sverre Seljebotn <
[email protected]> wrote:

> Anoop Saldanha wrote:
> > I think he/she has to supply the patch with the right type for the temp
> > variable.
> >
> > Should the type of the temp variable be of PyrexTypes.py_object_type?
> >  From what I can see, the code is currently using
> PyrexTypes.py_object_type.
>
> First off, I was wrong in my previous email; step is NOT put into a
> temporary, and it probably should be.
>
> Secondly, the type to use for temps should be the same as the nodes
> containing the expressions in question. E.g. self.step.type,
> self.bound1.type, and so on, contains references to the right type
> objects. (Inspect the tree of a for-loop by "print
> somenode.dump()"/"print self.dump()" to see how it works -- note that
> e.g. the type of IntNodes doesn't show up here as it is a hard-coded
> attribute for that class.)
>
> --
> Dag Sverre
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Regards,
Anoop S.

People who says, "It's not winning or losing that matters, but
participation", probably lost.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to