To create a temp of the right type for an expression, one can do a <br><br>code.funcstate.allocate_temp(self.bound2.type, manage_ref=False), where self.bound2 is the expresssion?<br><br>Also is there an irc channel for cython?<br>
<br>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.<br>
<br>But<br><br>cdef int g():<br> print "g called"<br> return 5<br><br>def f():<br> cdef int i<br> for i in range(g()):<br> print i<br> print i<br><br>uses a ForFromStatNode for the "for in" loop!<br>
<br><div class="gmail_quote">On Wed, Mar 18, 2009 at 2:44 PM, Dag Sverre Seljebotn <span dir="ltr"><<a href="mailto:dagss@student.matnat.uio.no" target="_blank">dagss@student.matnat.uio.no</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Anoop Saldanha wrote:<br>
> I think he/she has to supply the patch with the right type for the temp<br>
> variable.<br>
><br>
> Should the type of the temp variable be of PyrexTypes.py_object_type?<br>
> From what I can see, the code is currently using PyrexTypes.py_object_type.<br>
<br>
</div>First off, I was wrong in my previous email; step is NOT put into a<br>
temporary, and it probably should be.<br>
<br>
Secondly, the type to use for temps should be the same as the nodes<br>
containing the expressions in question. E.g. self.step.type,<br>
self.bound1.type, and so on, contains references to the right type<br>
objects. (Inspect the tree of a for-loop by "print<br>
somenode.dump()"/"print self.dump()" to see how it works -- note that<br>
e.g. the type of IntNodes doesn't show up here as it is a hard-coded<br>
attribute for that class.)<br>
<br>
--<br>
<font color="#888888">Dag Sverre<br>
</font><div><div></div><div>_______________________________________________<br>
Cython-dev mailing list<br>
<a href="mailto:Cython-dev@codespeak.net" target="_blank">Cython-dev@codespeak.net</a><br>
<a href="http://codespeak.net/mailman/listinfo/cython-dev" target="_blank">http://codespeak.net/mailman/listinfo/cython-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Anoop S.<br><br>People who says, "It's not winning or losing that matters, but participation", probably lost.<br>