diff options
Diffstat (limited to 'tests/run/cdef_multiple_inheritance_cimport.srctree')
-rw-r--r-- | tests/run/cdef_multiple_inheritance_cimport.srctree | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/run/cdef_multiple_inheritance_cimport.srctree b/tests/run/cdef_multiple_inheritance_cimport.srctree new file mode 100644 index 000000000..dd56b3e30 --- /dev/null +++ b/tests/run/cdef_multiple_inheritance_cimport.srctree @@ -0,0 +1,44 @@ +# 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 |