# Test for https://github.com/cython/cython/issues/4106 PYTHON setup.py build_ext --inplace PYTHON -c "import sub" ######## setup.py ######## from Cython.Build import cythonize from distutils.core import setup setup( ext_modules = cythonize("*.pyx"), ) ######## base.pxd ######## cdef class A: cdef dict __dict__ cdef int a(self) cdef class B(A): cdef int b(self) ######## base.pyx ######## cdef class A: cdef int a(self): return 1 class PyA: pass cdef class B(A, PyA): cdef int b(self): return 2 ######## sub.pyx ######## from base cimport B print(B) cdef class C(B): cdef int c(self): return 3