我可以import teapot
在交互式python中:
#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())
但是在I 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
将线路改为
我现在很清楚,西顿还没有赶上。这是Python的一个相对较新的特性。我花了好几天时间
相关问题 更多 >
编程相关推荐