Robert Bradshaw, 16.02.2010 22:24:
> On Feb 16, 2010, at 1:08 PM, Lisandro Dalcin wrote:
> 
>> That file lost backward-compatibility with Py2.3 (because it uses
>> 'set' builtin). As Parsin.py is one of these few files that are
>> cythonized,... Can you see any problem on the obvious patch below??:
>>
>>
>> $ hg diff Cython/Compiler/Parsing.py
>> diff -r 6fc30b5dadc3 Cython/Compiler/Parsing.py
>> --- a/Cython/Compiler/Parsing.py     Fri Feb 12 19:04:24 2010 +0100
>> +++ b/Cython/Compiler/Parsing.py     Tue Feb 16 18:06:03 2010 -0300
>> @@ -10,6 +10,13 @@
>> import os
>> import re
>> import sys
>> +
>> +try:
>> +    set
>> +except NameError:
>> +    # Python 2.3
>> +    from sets import Set as set
>> +
>> from Cython.Compiler.Scanning import PyrexScanner,  
>> FileSourceDescriptor
>> import Nodes
>> import ExprNodes
> 
> Looks fine to me. We do the same elsewhere.

This shadows the 'set' builtin, though, so Cython can't optimise it. That
may not be important in this case, but given that Cython "implements" the
set type for 2.3 anyway, would it make sense to provide the 'set' builtin
in Shadow.py and reimport it from there instead?

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to