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
31ca96cd
Commit
31ca96cd
authored
Dec 08, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
List/tuple boundscheck test.
parent
34587532
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tests/run/index.pyx
tests/run/index.pyx
+13
-0
No files found.
tests/run/index.pyx
View file @
31ca96cd
...
@@ -11,6 +11,7 @@ if sys.version_info[0] >= 3:
...
@@ -11,6 +11,7 @@ if sys.version_info[0] >= 3:
elif
sys
.
version_info
<
(
2
,
5
):
elif
sys
.
version_info
<
(
2
,
5
):
__doc__
=
__doc__
.
replace
(
u"'int' object is unsubscriptable"
,
u'unsubscriptable object'
)
__doc__
=
__doc__
.
replace
(
u"'int' object is unsubscriptable"
,
u'unsubscriptable object'
)
import
cython
def
index_tuple
(
tuple
t
,
int
i
):
def
index_tuple
(
tuple
t
,
int
i
):
"""
"""
...
@@ -113,3 +114,15 @@ def test_long_long():
...
@@ -113,3 +114,15 @@ def test_long_long():
assert
D
[
ix
]
is
True
assert
D
[
ix
]
is
True
del
D
[
ix
]
del
D
[
ix
]
assert
len
(
D
)
==
0
assert
len
(
D
)
==
0
@
cython
.
boundscheck
(
False
)
def
test_boundscheck
(
list
L
,
tuple
t
,
object
o
,
unsigned
long
ix
):
"""
>>> test_boundscheck([1, 2, 4], (1, 2, 4), [1, 2, 4], 2)
(4, 4, 4)
>>> test_boundscheck([1, 2, 4], (1, 2, 4), "", 2)
Traceback (most recent call last):
...
IndexError: string index out of range
"""
return
L
[
ix
],
t
[
ix
],
o
[
ix
]
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