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 &quot;for in&quot; and the latter would be used in case of &quot;for from&quot; loops.<br>
<br>But<br><br>cdef int g():<br>     print &quot;g called&quot;<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 &quot;for in&quot; loop!<br>
<br><div class="gmail_quote">On Wed, Mar 18, 2009 at 2:44 PM, Dag Sverre Seljebotn <span dir="ltr">&lt;<a href="mailto:dagss@student.matnat.uio.no" target="_blank">dagss@student.matnat.uio.no</a>&gt;</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>
&gt; I think he/she has to supply the patch with the right type for the temp<br>
&gt; variable.<br>
&gt;<br>
&gt; Should the type of the temp variable be of PyrexTypes.py_object_type?<br>
&gt;  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 &quot;print<br>
somenode.dump()&quot;/&quot;print self.dump()&quot; to see how it works -- note that<br>
e.g. the type of IntNodes doesn&#39;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, &quot;It&#39;s not winning or losing that matters, but participation&quot;, probably lost.<br>