Commit a0819490 authored by Stefan Behnel's avatar Stefan Behnel

extend fastcall tests with more Python calls that use METH_FASTCALL in Py3.6+

parent a47034e9
# mode: run # mode: run
# tag: METH_FASTCALL # tag: METH_FASTCALL
import struct
from collections import deque from collections import deque
...@@ -19,3 +20,17 @@ def deque_methods(v): ...@@ -19,3 +20,17 @@ def deque_methods(v):
assert list(d) == [1,2,3,4] assert list(d) == [1,2,3,4]
return list(d) return list(d)
def struct_methods(v):
"""
>>> i, lf = struct_methods(2)
>>> struct.unpack('i', i)
(2,)
>>> struct.unpack('lf', lf)
(2, 4.0)
"""
return [
struct.pack('i', v),
struct.pack('lf', v, v*2),
]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment