Can you produce a testcase for this issue? It is *critical* for fast symbolics in Sage, so I would prefer to fix the bug as opposed to reverting. I see the problem now, but I will need the test cases you are using to produce a fix. Once I have them it should be a relatively easy patch. <br>
<br><div class="gmail_quote">On Tue, Apr 8, 2008 at 11:50 AM, Stefan Behnel <<a href="mailto:stefan_ml@behnel.de" target="_blank">stefan_ml@behnel.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<div><div></div><div><br>
Gary Furnish wrote:<br>
> This patch adds extra logic to code generation to sort dependencies to<br>
> guarantee that C code is generated in the right order for circular cdef<br>
> imports. It does NOT solve python circular import issues.<br>
> a.pyx: cimport b<br>
> b.pyx: cimport a<br>
> Is thus legal, but you can not reference a or b in the global namespace of<br>
> b.pyx or a.pyx (such as to instantiate a class).<br>
> This patch also modifies cython to output the exact line in the C code where<br>
> an exception was thrown in addition to the currently displayed pyx file and<br>
> line. This enables significantly faster developmental debugging.<br>
> Finally it splits module initialization into two phases: one that initiates<br>
> types and handles imports, and another that executes python commands at the<br>
> global namespace level. This will be more useful as Cython starts to assume<br>
> more advanced optimization and code generation features<br>
> The patch is available at:<br>
> <a href="http://trac.sagemath.org/sage_trac/ticket/2655%28the" target="_blank">http://trac.sagemath.org/sage_trac/ticket/2655(the</a> third attachment<br>
> only) and is based against <a href="http://0.9.6.12" target="_blank">0.9.6.12</a>,<br>
> although I can rebase if needed. I am hoping this can be merged into<br>
> Cython.<br>
<br>
</div></div>The patch doesn't work for me. When I fix the problems with the header file<br>
generation, I end up with C code that defines the "__pyx_obj_*" class structs<br>
in the wrong order. Note that there are no circular dependencies involved in<br>
my case and that the two classes where the problem occurs are defined in the<br>
same source file (although their highest base class is defined in a separate<br>
file, not sure if that matters.<br>
<br>
Personally, seeing all problems I have with this patch and not really seeing a<br>
clear gain, I would just revert the patch for now.<br>
<font color="#888888"><br>
Stefan<br>
<br>
</font></blockquote></div><br>