Robin Becker wrote:
> I have some older code that used to run with pyrex without complaint, but
> now the following
>
> cdef extern from "listobject.h":
>       ctypedef class __builtin__.list [object PyListObject]:
>               pass
>
> causes a warning
>> warning: C:\code\users\robin\_tex_wrap.pyx:144:1: list already a builtin
>> Cython type

Yes, that warning is currently a bit misleading in this specific case, as
there is not yet a way to achieve inheritance of builtin types without the
above declaration. It's meant more for code that uses the declared type in
other places than supertypes, where Cython now handles these types better
on its own.

This is what ticket #258 is supposed to mean.

http://trac.cython.org/cython_trac/ticket/258

See also ticket #170:

http://trac.cython.org/cython_trac/ticket/170

If you use the "list" type only for subtypes, just ignore the warning. It
will become an error once Cython can deal with this case directly, so you
will notice when it's time to remove the declaration.

Stefan

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

Reply via email to