On 5 July 2010 11:32, Stefan Behnel <[email protected]> wrote: > Hi, > > Py2.7 final gives me this: > > Python 2.7 (r27:82500, Jul 5 2010, 13:37:06) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > > >>> {i for i in range(10)}; i > set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > NameError: name 'i' is not defined > > >>> {i:i for i in range(10)}; i > {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9} > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > NameError: name 'i' is not defined > > List comprehensions have not changed: > > >>> [i for i in range(10)]; i > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > 9 > > I know, I have asked this more than once already, but I think this is > finally enough of a reason to fix the current behaviour also in Cython. >
No objections from my side. However, perhaps you would like to consider a compiler directive to enable this annoying thing? Ideally, by default, it should be enabled on *.py files and disabled on *.pyx files. PS: We have to start in making Cython target Python 3, and provide support for Python 2 features on-demand, let say by using a compiler directive #python2: enable-something=True,use-this-semantics=True -- Lisandro Dalcin --------------- CIMEC (INTEC/CONICET-UNL) Predio CONICET-Santa Fe Colectora RN 168 Km 472, Paraje El Pozo Tel: +54-342-4511594 (ext 1011) Tel/Fax: +54-342-4511169 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
