module documentation
Plugin to provide accurate types for some parts of the ctypes module.
Function | array |
Callback to provide an accurate signature for the ctypes.Array constructor. |
Function | array |
Callback to provide an accurate return type for ctypes.Array.__getitem__. |
Function | array |
Callback to provide an accurate return type for ctypes.Array.__iter__. |
Function | array |
Callback to provide an accurate type for ctypes.Array.raw. |
Function | array |
Callback to provide an accurate signature for ctypes.Array.__setitem__. |
Function | array |
Callback to provide an accurate type for ctypes.Array.value. |
Function | _autoconvertible |
Get a type that is compatible with all types that can be implicitly converted to the given CData type. |
Function | _autounboxed |
Get the auto-unboxed version of a CData type, if applicable. |
Function | _find |
Try to find a parametrized _SimpleCData in tp's bases and return its single type argument. |
Function | _get |
Get the element type of the Array type tp, or None if not specified. |
def _autoconvertible_to_cdata(tp:
Type
, api: mypy.plugin.CheckerPluginInterface
) -> Type
:
(source)
¶
Get a type that is compatible with all types that can be implicitly converted to the given CData type. Examples: * c_int -> Union[c_int, int] * c_char_p -> Union[c_char_p, bytes, int, NoneType] * MyStructure -> MyStructure
Get the auto-unboxed version of a CData type, if applicable. For *direct* _SimpleCData subclasses, the only type argument of _SimpleCData in the bases list is returned. For all other CData types, including indirect _SimpleCData subclasses, tp is returned as-is.
def _find_simplecdata_base_arg(tp:
Instance
, api: mypy.plugin.CheckerPluginInterface
) -> ProperType|None
:
(source)
¶
Try to find a parametrized _SimpleCData in tp's bases and return its single type argument. None is returned if _SimpleCData appears nowhere in tp's (direct or indirect) bases.