Commit 50f24198 authored by Mark Florisson's avatar Mark Florisson

Fix fused function __doc__ descriptor

parent 425ffcd3
...@@ -900,7 +900,9 @@ static PyTypeObject __pyx_FusedFunctionType_type = { ...@@ -900,7 +900,9 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
0, /*tp_iternext*/ 0, /*tp_iternext*/
0, /*tp_methods*/ 0, /*tp_methods*/
__pyx_FusedFunction_members, /*tp_members*/ __pyx_FusedFunction_members, /*tp_members*/
0, /*tp_getset*/ /* __doc__ is None for the fused function type, but we need it to be */
/* a descriptor for the instance's __doc__, so rebuild descriptors in our subclass */
__pyx_CyFunction_getsets, /*tp_getset*/
&__pyx_CyFunctionType_type, /*tp_base*/ &__pyx_CyFunctionType_type, /*tp_base*/
0, /*tp_dict*/ 0, /*tp_dict*/
__pyx_FusedFunction_descr_get, /*tp_descr_get*/ __pyx_FusedFunction_descr_get, /*tp_descr_get*/
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
cimport numpy as np cimport numpy as np
cimport cython cimport cython
import sys
from libc.stdlib cimport malloc from libc.stdlib cimport malloc
def little_endian(): def little_endian():
...@@ -16,9 +18,9 @@ def testcase(f): ...@@ -16,9 +18,9 @@ def testcase(f):
__test__[f.__name__] = f.__doc__ __test__[f.__name__] = f.__doc__
return f return f
def testcase_numpy_1_5(f): def testcase_have_buffer_interface(f):
major, minor, *rest = np.__version__.split('.') major, minor, *rest = np.__version__.split('.')
if (int(major), int(minor)) >= (1, 5): if (int(major), int(minor)) >= (1, 5) and sys.version_info[:2] >= (2, 6):
__test__[f.__name__] = f.__doc__ __test__[f.__name__] = f.__doc__
return f return f
...@@ -654,7 +656,7 @@ def get_Foo_array(): ...@@ -654,7 +656,7 @@ def get_Foo_array():
result[5].b = 9.0 result[5].b = 9.0
return np.asarray(result) return np.asarray(result)
@testcase_numpy_1_5 @testcase_have_buffer_interface
def test_fused_ndarray(fused_ndarray a): def test_fused_ndarray(fused_ndarray a):
""" """
>>> import cython >>> import cython
...@@ -703,9 +705,9 @@ cpdef test_fused_cpdef_ndarray(fused_ndarray a): ...@@ -703,9 +705,9 @@ cpdef test_fused_cpdef_ndarray(fused_ndarray a):
else: else:
print b[5] print b[5]
testcase_numpy_1_5(test_fused_cpdef_ndarray) testcase_have_buffer_interface(test_fused_cpdef_ndarray)
@testcase_numpy_1_5 @testcase_have_buffer_interface
def test_fused_cpdef_ndarray_cdef_call(): def test_fused_cpdef_ndarray_cdef_call():
""" """
>>> test_fused_cpdef_ndarray_cdef_call() >>> test_fused_cpdef_ndarray_cdef_call()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment