Dag Sverre Seljebotn, 05.07.2010 19:38:
> Stefan Behnel wrote:
>> Lisandro Dalcin, 05.07.2010 18:11:
>>> On 5 July 2010 12:34, Stefan Behnel wrote:
>>>> Lisandro Dalcin, 05.07.2010 17:15:
>>>>> On 5 July 2010 11:32, Stefan Behnel wrote:
>>>>>> 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.
>>>>> [...]
>>>>> 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
>>>>>
>>>> There are "-2" and "-3" options at the command line and a "language_level"
>>>> directive at the source level now.
>>>>
>>> OK. Good to know we have -2/-3. Then, what are you going to do under
>>> -2 for list comprehensions?
>>
>> Oh, list comprehensions won't change (unless compiling with -3), thus
>> keeping the same quirky state that they have in Py2.x. Only set/dict
>> comprehensions will change, following Py2.7, so that list comprehensions
>> are the *only* remaining quirk here when compiling Py2 code.
>>
> Oh. Then I really can't imagine how anyone could ever disagree with you
> on this one.
Haven't heard from Robert yet, but let's assume that Py2.7 taking the lead
won't be a problem for him, either.
http://hg.cython.org/cython-closures/rev/cfbc219602b6
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev