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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
0ef0a005
Commit
0ef0a005
authored
Oct 11, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for cfunc auto-wrapping at module level
parent
63a5d786
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/run/cfunc_convert.pyx
tests/run/cfunc_convert.pyx
+17
-0
No files found.
tests/run/cfunc_convert.pyx
View file @
0ef0a005
# mode: run
# mode: run
# cython: always_allow_keywords=True
# cython: always_allow_keywords=True
cimport
cython
from
libc.math
cimport
sqrt
from
libc.math
cimport
sqrt
...
@@ -56,6 +57,22 @@ def return_libc_sqrt():
...
@@ -56,6 +57,22 @@ def return_libc_sqrt():
return
sqrt
return
sqrt
global_csqrt
=
sqrt
def
test_global
():
"""
>>> global_csqrt(9)
3.0
>>> global_csqrt.__doc__
'wrap(x: float) -> float'
>>> test_global()
double (double) nogil
Python object
"""
print
cython
.
typeof
(
sqrt
)
print
cython
.
typeof
(
global_csqrt
)
cdef
long
long
rad
(
long
long
x
):
cdef
long
long
rad
(
long
long
x
):
cdef
long
long
rad
=
1
cdef
long
long
rad
=
1
for
p
in
range
(
2
,
<
long
long
>
sqrt
(
x
)
+
1
):
for
p
in
range
(
2
,
<
long
long
>
sqrt
(
x
)
+
1
):
...
...
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