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
Boxiang Sun
cython
Commits
c08d22ce
Commit
c08d22ce
authored
Apr 07, 2011
by
Haoyu Bai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests
parent
d1c5392e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
tests/run/directive_locals_in_pxd.pxd
tests/run/directive_locals_in_pxd.pxd
+6
-0
tests/run/directive_locals_in_pxd.py
tests/run/directive_locals_in_pxd.py
+20
-6
No files found.
tests/run/directive_locals_in_pxd.pxd
View file @
c08d22ce
...
...
@@ -2,3 +2,9 @@ cimport cython
@
cython
.
locals
(
egg
=
double
)
cdef
foo
(
egg
)
@
cython
.
locals
(
egg
=
cython
.
double
)
cdef
foo_defval
(
egg
=*
)
@
cython
.
locals
(
egg
=
cython
.
bint
,
v
=
cython
.
int
)
cpdef
cpfoo
(
egg
=*
)
tests/run/directive_locals_in_pxd.py
View file @
c08d22ce
import
cython
# @cython.locals(x=double)
# cdef func_defval(x=0):
# return x**2
def
foo
(
egg
):
if
not
cython
.
compiled
:
egg
=
float
(
egg
)
return
egg
def
foo_defval
(
egg
=
1
):
if
not
cython
.
compiled
:
egg
=
float
(
egg
)
return
egg
**
2
def
cpfoo
(
egg
=
False
):
if
not
cython
.
compiled
:
egg
=
bool
(
egg
)
v
=
int
(
not
egg
)
else
:
v
=
not
egg
return
egg
,
v
def
test_pxd_locals
():
"""
>>> isinstance(test_pxd_locals(), float)
>>> v1, v2, v3 = test_pxd_locals()
>>> isinstance(v1, float)
True
>>> isinstance(v2, float)
True
>>> v3
(True, 0)
"""
return
foo
(
1
)
return
foo
(
1
)
,
foo_defval
(),
cpfoo
(
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