From: Charlie G. <cha...@gm...> - 2007-02-28 17:18:27
|
http://jython.org/bugs/1230674 explains that from __future__ doesn't work from the interpreter. We've got a patch for it, so it should fixed in 2.2 but it hasn't been applied yet. You should be able to use generators from a .py file without problems now. Charlie On 2/28/07, marcel liker <m_...@ya...> wrote: > Hi there, > I am wondering why does jython 2.2b1 fail to import pyparsing (1.4.5) module. > > >>> from __future__ import generators > >>> import pyparsing > Traceback (innermost last): > File "<console>", line 1, in ? > File "/home/marcel/jython22b1/Lib/pyparsing.py", line 849 > yield tokens, preloc, nextLoc > ^ > SyntaxError: invalid syntax > > where a function like this works as expected: > > >>> def generate_ints(N): > ... for i in range(N): > ... yield i > ... > >>> > >>> a= generate_ints(3) > >>> a.next() > 0 > >>> a.next() > 1 > >>> a.next() > 2 > >>> a.next() > Traceback (innermost last): > File "<console>", line 1, in ? > StopIteration: > > > Thanks for any and all help. > Marcel > > > > > > > > ___________________________________________________________ > New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. > http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |