Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
50f24198
Commit
50f24198
authored
May 13, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fused function __doc__ descriptor
parent
425ffcd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
Cython/Utility/CythonFunction.c
Cython/Utility/CythonFunction.c
+3
-1
tests/run/numpy_test.pyx
tests/run/numpy_test.pyx
+7
-5
No files found.
Cython/Utility/CythonFunction.c
View file @
50f24198
...
...
@@ -900,7 +900,9 @@ static PyTypeObject __pyx_FusedFunctionType_type = {
0
,
/*tp_iternext*/
0
,
/*tp_methods*/
__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*/
0
,
/*tp_dict*/
__pyx_FusedFunction_descr_get
,
/*tp_descr_get*/
...
...
tests/run/numpy_test.pyx
View file @
50f24198
...
...
@@ -4,6 +4,8 @@
cimport
numpy
as
np
cimport
cython
import
sys
from
libc.stdlib
cimport
malloc
def
little_endian
():
...
...
@@ -16,9 +18,9 @@ def testcase(f):
__test__
[
f
.
__name__
]
=
f
.
__doc__
return
f
def
testcase_
numpy_1_5
(
f
):
def
testcase_
have_buffer_interface
(
f
):
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__
return
f
...
...
@@ -654,7 +656,7 @@ def get_Foo_array():
result
[
5
].
b
=
9.0
return
np
.
asarray
(
result
)
@
testcase_
numpy_1_5
@
testcase_
have_buffer_interface
def
test_fused_ndarray
(
fused_ndarray
a
):
"""
>>> import cython
...
...
@@ -703,9 +705,9 @@ cpdef test_fused_cpdef_ndarray(fused_ndarray a):
else
:
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
():
"""
>>> test_fused_cpdef_ndarray_cdef_call()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment