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
77970aa5
Commit
77970aa5
authored
Jul 13, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend fastcall test
parent
5e221d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
tests/run/fastcall.pyx
tests/run/fastcall.pyx
+11
-1
No files found.
tests/run/fastcall.pyx
View file @
77970aa5
...
@@ -5,6 +5,8 @@ import sys
...
@@ -5,6 +5,8 @@ import sys
import
struct
import
struct
from
collections
import
deque
from
collections
import
deque
pack
=
struct
.
pack
def
deque_methods
(
v
):
def
deque_methods
(
v
):
"""
"""
...
@@ -16,6 +18,7 @@ def deque_methods(v):
...
@@ -16,6 +18,7 @@ def deque_methods(v):
if
sys
.
version_info
>=
(
3
,
5
):
if
sys
.
version_info
>=
(
3
,
5
):
d
.
insert
(
1
,
v
)
d
.
insert
(
1
,
v
)
else
:
else
:
# deque has no 2-args methods in older Python versions
d
.
rotate
(
-
1
)
d
.
rotate
(
-
1
)
d
.
appendleft
(
2
)
d
.
appendleft
(
2
)
d
.
rotate
(
1
)
d
.
rotate
(
1
)
...
@@ -30,13 +33,20 @@ def deque_methods(v):
...
@@ -30,13 +33,20 @@ def deque_methods(v):
def
struct_methods
(
v
):
def
struct_methods
(
v
):
"""
"""
>>> i, lf = struct_methods(2)
>>> i, lf
, i2, f
= struct_methods(2)
>>> struct.unpack('i', i)
>>> struct.unpack('i', i)
(2,)
(2,)
>>> struct.unpack('i', i2)
(2,)
>>> struct.unpack('lf', lf)
>>> struct.unpack('lf', lf)
(2, 4.0)
(2, 4.0)
>>> struct.unpack('f', f)
(2.0,)
"""
"""
local_pack
=
pack
return
[
return
[
struct
.
pack
(
'i'
,
v
),
struct
.
pack
(
'i'
,
v
),
struct
.
pack
(
'lf'
,
v
,
v
*
2
),
struct
.
pack
(
'lf'
,
v
,
v
*
2
),
pack
(
'i'
,
v
),
local_pack
(
'f'
,
v
),
]
]
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