cython失败或我做错了?

2024-05-29 02:35:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我可以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

Tags: pyimportselfreturnabinitdefac

热门问题