我可以在交互式python中import teapot
:
#teapot.py
class _A():
def __init__(self):
self.a = 1
def _gen(c,AB):
class ABC(AB):
def __init__(self):
super().__init__()
self.c = c
return ABC
_AC = _gen(3,_A)
print(_AC)
print(_AC())
但是在我cythonize -X language_level=3 -i teapot.py
之后,启动python交互式会话,然后import teapot
,该交互式会话直接退出。怎么了?
Name Version Build Channel
cython 0.29.10 py37h6538335_0 conda-forge
python 3.7.4 h5263a28_0