On Dec 6, 2009, at 12:25 PM, Dag Sverre Seljebotn wrote:
> I'm bringing this over from the NumPy list. I'm guessing this
> behaviour is
> there so that subclasses written in Cython won't break?
Also, very hard to diagnose behavior can happen if you change a class
(for example, add or remove a cdef attribute) without re-compiling
everything that depends on it. I'd like to have stronger checks on
extending from other Cython classes.
> Perhaps the error
> message could at least be made clearer ("please recompile") +
> perhaps only
> do this check for types which are subclassed?
+1 to making the error more clear--the current one is far from clear.
>
> Dag Sverre
>
> On Sun, Dec 6, 2009 at 07:53, Gael Varoquaux
> <[email protected]> wrote:
>> I have a lot of code that has stopped working with my latest SVN
>> pull to
>> numpy.
>>
>> * Some compiled code yields an error looking like (from memory):
>>
>> "incorrect type 'numpy.ndarray'"
>>
>> Rebuilding it is sufficient.
>
> Is this Cython or Pyrex code? Unfortunately Pyrex checks the size of
> types exactly such that even if you extend the type in a backwards
> compatible way, it will raise that exception. This behavior has been
> inherited by Cython. I have asked for this feature to be removed, or
> at least turned into a >= check, but it got no traction.
Could you better describe your usecase? You have a Cython type that
you then extend from C and try to use from Cython again without
redeclaring it?
- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev