I have a A.pxd (with just declaration of functions) and A.pyx that contains just a class A with all the function body.
Than I have B that inherits from A,
and for B I have B.pxd with some functions
B.pyx
class Bclass(A):
#all the funcions body
I want to now how to tell to B.pyx to ricognise A as a type name?
what i do is:
B.pyx
cimport A
import A
from A import Aclass
cdef Bclass(Aclass):
#body
but it says me: A is not a type name
If i do this in just one file.pyx it works without problems but working with files.pxd it does not go.
Use
from A cimport Aclass
cdef class Bclass(Aclass):
# ...
or
cimport A
cdef class Bclass(A.Aclass):
# ...
Note that Aclass must be cdef'fed class, Cython extension types cannot inherit from Python classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With