<br><div class="gmail_quote">On Sun, Feb 13, 2011 at 9:55 PM, Vitja Makarov <span dir="ltr"><<a href="mailto:vitja.makarov@gmail.com">vitja.makarov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/2/14 Dan Stromberg <<a href="mailto:strombrg@gmail.com">strombrg@gmail.com</a>>:<br>
<div><div></div><div class="h5">><br>
> On Sun, Feb 13, 2011 at 5:17 PM, Dan Stromberg <<a href="mailto:strombrg@gmail.com">strombrg@gmail.com</a>> wrote:<br>
>><br>
>> On Sun, Feb 6, 2011 at 3:38 AM, Vitja Makarov <<a href="mailto:vitja.makarov@gmail.com">vitja.makarov@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> 2011/2/6 Dan Stromberg <<a href="mailto:strombrg@gmail.com">strombrg@gmail.com</a>>:<br>
>>> ><br>
>>> > On Sat, Feb 5, 2011 at 3:10 PM, Vitja Makarov <<a href="mailto:vitja.makarov@gmail.com">vitja.makarov@gmail.com</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> 2011/2/6 Vitja Makarov <<a href="mailto:vitja.makarov@gmail.com">vitja.makarov@gmail.com</a>>:<br>
>>> >> > 2011/2/6 Dan Stromberg <<a href="mailto:strombrg@gmail.com">strombrg@gmail.com</a>>:<br>
>>> >> >><br>
>>> >> >> Just a quick note to let you know I'm very eager to have working<br>
>>> >> >> generators<br>
>>> >> >> (yield) in Cython... ^_^ It's frequently the main thing that<br>
>>> >> >> complicates<br>
>>> >> >> moving my critical sections to Cython.<br>
>>> >> >> --<br>
>>> >> >> Dan Stromberg<br>
>>> >> >><br>
>>> >> ><br>
>>> >> > Ok, you will see generators soon in cython))) the most important<br>
>>> >> > part<br>
>>> >> > is already implemented, but I'm not sure that's the importetant<br>
>>> >> > one;)<br>
>>> >> ><br>
>>> >><br>
>>> >> now you can use my github repo at <a href="https://github.com/vitek/cython" target="_blank">https://github.com/vitek/cython</a><br>
>>> ><br>
>>> > Hey, that's great.<br>
>>> > I tried a little test program with it, and it worked great. I'll<br>
>>> > likely<br>
>>> > give it a try with a more real-world workload before long.<br>
>>> > Does it pass all the tests you've thrown at it yet?<br>
>>> > Thanks!<br>
>>> ><br>
>>><br>
>>> Hmm now it work as excepted. If you will find a case when it doesn't<br>
>>> work, report it.<br>
>>> See also tests at tests/run/generators.pyx<br>
>>><br>
>>> --<br>
>>> vitja.<br>
>><br>
>> Do you want e-mail, or a formal bug tracking entry?<br>
>> In case you want e-mail:<br>
>> + /usr/local/cpython-2.5/bin/python /usr/local/cpython-2.5/bin/cython<br>
>> rolling_checksum_pyx_mod.pyx<br>
>> Error compiling Cython file:<br>
>> ------------------------------------------------------------<br>
>> ...<br>
>> import os<br>
>> import sys<br>
>> #mport comma_mod<br>
>> def min_max_chunker(file_handle):<br>
>> ^<br>
>> ------------------------------------------------------------<br>
>> rolling_checksum_pyx_mod.pyx:9:0: Compiler crash in MarkClosureVisitor<br>
>> ModuleNode.body = StatListNode(rolling_checksum_pyx_mod.pyx:4:0)<br>
>> StatListNode.stats[2] = StatListNode(rolling_checksum_pyx_mod.pyx:9:0)<br>
>> StatListNode.stats[0] = DefNode(rolling_checksum_pyx_mod.pyx:9:0,<br>
>> doc = u'Make sure chunk sizes are above and below a pair of<br>
>> thresholds',<br>
>> modifiers = [...]/0,<br>
>> name = u'min_max_chunker',<br>
>> num_required_args = 1,<br>
>> reqd_kw_flags_cname = '0')<br>
>> Compiler crash traceback from this point on:<br>
>> File "Visitor.py", line 173, in<br>
>> Cython.Compiler.Visitor.TreeVisitor._visitchild<br>
>> (Cython/Compiler/Visitor.c:3508)<br>
>> File<br>
>> "/usr/local/cpython-2.5/lib/python2.5/site-packages/Cython/Compiler/ParseTreeTransforms.py",<br>
>> line 1380, in visit_FuncDefNode<br>
>> for i, yield_expr in enumerate(collector.yields, 1):<br>
>> TypeError: enumerate() takes exactly 1 argument (2 given)<br>
>> make: *** [rcms] Error 1<br>
>><br>
>><br>
>> The code that produced this is<br>
>> at <a href="http://stromberg.dnsalias.org/svn/backshift/trunk/" target="_blank">http://stromberg.dnsalias.org/svn/backshift/trunk/</a> - with make target<br>
>> "rcms". It expects to find a variety of cpython's at<br>
>> /usr/local/cpython-x.y/bin/python .<br>
><br>
><br>
> Oh, and of course, to eliminate some details for you, here's the<br>
> (automatically generated via m4) file that's giving the compiler error<br>
> (attached).<br>
> I suspect this issue may just be because a 2.x-ism (x>5) with how enumerate<br>
> is used has crept into cython.<br>
> Thanks!<br>
<br>
<br>
</div></div>Hi!<br>
<br>
It seems that you have old python version, 2.4?<br></blockquote><div>It's 2.5.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Here is a fix:<br>
<a href="https://github.com/vitek/cython/commit/bb8cd8275bf910117750356845814d4d9d998d6e" target="_blank">https://github.com/vitek/cython/commit/bb8cd8275bf910117750356845814d4d9d998d6e</a></blockquote><div>Thanks, but... How do I apply this? I tried git pull and git clone, but neither worked for me. I know SVN pretty well, but I haven't used git much yet.</div>
<div><br></div></div>-- <br>Dan Stromberg<br>