Opened 6 years ago

#567 new defect

super doesn't work with cpdef methods

Reported by: robertwb Owned by: somebody
Priority: major Milestone: wishlist
Component: Code Generation Keywords:


On Thu, Aug 12, 2010 at 1:32 PM, Ken wrote:

> Having a bit of a problem with the super keyword in cpdef functions.
> It works for __init__ and friends, but not this:
> cdef class A:
>    cpdef foo(self):
>        print "Foo"
> cdef class B(A):
>    cpdef foo(self):
>        super(B,self).foo()
>        print "Bar"
> cdef class C(B):
>    cpdef foo(self):
>        super(C,self).foo()
>        print "Plugh"
> Calling foo from C results in an infinite recursion between and
> If this were python code (and A extended object), this would work.
> Making A extend object doesn't help in the cython code. Changing
> super(C,self).foo() to and super(B,self).foo() to
> makes it work.

Change History (0)

Note: See TracTickets for help on using tickets.