1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
cdef class Parrot: cdef void describe(self): print("This parrot is resting.") cdef class Norwegian(Parrot): cdef void describe(self): Parrot.describe(self) print("Lovely plumage!") cdef Parrot p1, p2 p1 = Parrot() p2 = Norwegian() print("p2:") p2.describe()