Cython 1.1.2 和 const 正确性

发布于 2024-12-14 07:17:54 字数 267 浏览 2 评论 0原文

我正在尝试使用 Cython 为我的 C 库编写 python 扩展。我创建了一个 setup.py 文件 - 但是当我尝试构建 pxd 和 pyx 文件时,出现错误。

经过一番调查,Cython 似乎无法使用 const 参数来理解函数。每当我删除 const 说明符时,编译都会继续,直到下一个具有 const 参数的函数原型。

这是 Cython 的已知限制 - 还是我错过了一些更基本的东西?

我正在使用 Python 2.6.5 运行 Cython 0.11.2

I am experimenting with Cython to write a python extension for my C library. I have created a setup.py file - but when I try to build my pxd and pyx files, I get an error.

After some investigation, it appears that Cython cannot grok functions with const parameters. Whenever I remove the const specifier, the compilation continues until the next function protype that has a const argument.

Is this a known limitation of Cython - or am I missing something more fundamental?

I am running Cython 0.11.2 with Python 2.6.5

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赏烟花じ飞满天 2024-12-21 07:17:54

这是一个已知的限制,Cython 自己的文档中记录了解决方法此处

This is a known limitation, with workarounds documented in Cython's own documentation here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文