【发布时间】:2014-01-26 01:34:57
【问题描述】:
这是this question的后续行动。
(为什么/何时)最好使用Py_ssize_t 进行索引?在我刚刚发现的docs中
# Purists could use "Py_ssize_t" which is the proper Python type for # array indices.
-> 这是否意味着在索引 NumPy/Cython 时总是 - 数组/视图应该使用 Py_ssize_t?
-> 是Py_ssize_t e。 G。一个unsigned int,这样我就不能使用@cython.boundscheck(False)
【问题讨论】:
-
另外,来自 Cython 文档:“Py_ssize_t 是 Python 数组索引的正确 C 类型。”
标签: python numpy indexing cython unsigned-integer