Hi

I just spotted an inconsistency, which might be a minor bug:

If I declare a variable of type 'list' without initializing it and then 
try to use it, I get an error that my object is actually None, which 
makes sense:

def test1():
    cdef list l
    l.append( "A" )

$ python -c 'import test; test.test1()'
Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "test.pyx", line 3, in test.test1 (test.c:396)
     l.append( "A" )
AttributeError: 'NoneType' object has no attribute 'append'


However, if I do the same with a set, an internal error is triggered:

def test2():
    cdef set s
    s.add( "A" )

$ python -c 'import test; test.test2()'
Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "test.pyx", line 7, in test.test2 (test.c:434)
     s.add( "A" )
SystemError: Objects/setobject.c:2303: bad argument to internal function


I'm using Python 2.6.1 and Cython 0.13 on CentOS Linux 4.8 x86_64.

   Simon

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

Reply via email to