Closed s-m-e closed 6 years ago
This is how ctypes
expects the definition of a single argument:
>>> import ctypes
>>> dll = ctypes.cdll.msvcrt
>>> demo = dll.sqrt
>>> demo.argtypes = (ctypes.c_double,)
>>> demo.restype = ctypes.c_double
>>> demo(9.0)
3.0
This is how it throws an error if the argtypes
are not initialized with a tuple or list:
>>> import ctypes
>>> dll = ctypes.cdll.msvcrt
>>> demo = dll.sqrt
>>> demo.argtypes = ctypes.c_double
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: _argtypes_ must be a sequence of types
zugbruecke
currently crashes when parsing demo.argtypes = ctypes.c_double
, which is sort of right - it should actually throw a TypeError
instead (#8).
Fixed in 679b383.
Fix released as part of v0.0.8.
See here.