提交 662e811d authored 作者: James Bergstra's avatar James Bergstra

added comment to scalar c_extract function, explaining one way to go about…

added comment to scalar c_extract function, explaining one way to go about fixing the broken scalar module
上级 2c5d9e37
...@@ -146,6 +146,13 @@ class Scalar(Type): ...@@ -146,6 +146,13 @@ class Scalar(Type):
def c_extract(self, name, sub): def c_extract(self, name, sub):
specs = self.dtype_specs() specs = self.dtype_specs()
#TODO: This is the wrong code, but we don't know what to change it to.
# For example, a numpy.uint8 is not a PyInt, so PyInt_Check
# is simply the wrong function to
# call.
# Look at PyArrayScalar api for how to cast to/from PyArrayScalar objects.
# numpy.uint* numpy.float* are all constructors of PyArrayScalar objects.
#
return """ return """
if (!%(check)s(py_%(name)s)) if (!%(check)s(py_%(name)s))
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论