On Sep 17, 2009, at 2:18 PM, Magnus Lie Hetland wrote:

> I've encountered some behavior that I don't quite understand in Cython
> pure Python mode.

Is this just in pure mode, or a general problem? (FYI, pure mode is  
still somewhat experimental--users like you will help iron out all  
the corner cases (though it should basically just work)).

> I've got three classes, Foo, Bar and Baz. Both Bar
> and Baz inherit from Foo. All three implement the empty method quux().
> (The problem also occurs if Bar inherits this from Foo -- but *not* if
> Baz does.)
>
> The .pxd file looks like this:
>
>> cdef class Foo:
>>
>>     cpdef quux(self)
>>
>> cdef class Bar(Foo):
>>
>>     cpdef quux(self)
>>
>> cdef class Baz(Foo):
>>
>>     cpdef quux(self)

You shouldn't need to re-declare the cpdef method in each class--it  
should get it by inheritance. (Should we raise an error in this  
case?) Do you still have problems if you don't redeclare the method  
in Bar and Baz? In any case, it's a bug one way or another.

- Robert

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

Reply via email to