PrimitiveType
Defines a general purpose ArgumentType so that we can easily manage complicated type specs
The basic idea is to define a hierarchy of types that can then convert themselves down to
a ctypes-style spec as well as a C++ argument spec so that we can enable SharedLibraryFunction
to use either the basic ctypes FFI or a more efficient, but fragile system based off of extension modules
typeset: dict
__init__(self, name, ctypes_spec, cpp_spec, capi_spec, python_types, numpy_dtypes, serializer, deserializer):
name:strargument name (e.g. ‘double’)
ctypes_spec:Anythe ctypes data-type that arguments of this type would be converted to
cpp_spec:strthe C++ spec for this type (as a string)
capi_spec:strthe python C-API string for use in
Py_BuildValuepython_types:Iterable[type]the python types that this argument maps onto
numpy_dtypes:Iterable[np.dtype]the numpy dtypes that this argument maps onto
serializer:Callablea serializer for converting this object into a byte-stream
deserializer:Callablea deserializer for converting the byte-stream into a C-level object
@property
name(self):
@property
ctypes_type(self):
@property
cpp_type(self):
@property
types(self):
@property
dtypes(self):
@property
typechar(self):
isinstance(self, arg):
cast(self, arg):
c_cast(self, arg):
__repr__(self):