blob: 2eef6946080715796033f153c22119d510235663 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
@cython.cclass
class Animal:
number_of_legs: cython.int
def __cinit__(self, number_of_legs: cython.int):
self.number_of_legs = number_of_legs
class ExtendableAnimal(Animal): # Note that we use class, not cdef class
pass
dog = ExtendableAnimal(4)
dog.has_tail = True
|