Commit 417023d4 authored by Stefan Behnel's avatar Stefan Behnel

Add some missing types to Shadow.pyi and comment out incomplete ones.

parent 969e3439
from builtins import (int as py_int, float as py_float,
bool as py_bool, str as py_str)
bool as py_bool, str as py_str, complex as py_complex)
from typing import (Union, Dict, Any, Sequence, Optional,
List, TypeVar, Type, Generic)
......@@ -20,12 +20,19 @@ ushort = py_int
uchar = py_int
size_t = py_int
Py_ssize_t = py_int
Py_UCS4 = Union[py_int, str]
Py_UNICODE = Union[py_int, str]
float = py_float
double = py_float
longdouble = py_float
complex = py_complex
floatcomplex = py_complex
doublecomplex = py_complex
longdoublecomplex = py_complex
bint = py_bool
void = Union[None]
basestring = py_str
unicode = py_str
gs: Dict[str, Any] # Should match the return type of globals()
......@@ -56,8 +63,7 @@ class CythonType(CythonTypeObject):
class PointerType(CythonType, Generic[_T]):
def __init__(
self,
value: Optional[Union[ArrayType[_T],
PointerType[_T], List[_T], int]] = ...
value: Optional[Union[ArrayType[_T], PointerType[_T], List[_T], int]] = ...
) -> None: ...
def __getitem__(self, ix: int) -> _T: ...
def __setitem__(self, ix: int, value: _T) -> None: ...
......@@ -67,11 +73,11 @@ class PointerType(CythonType, Generic[_T]):
class ArrayType(PointerType[_T]):
def __init__(self) -> None: ...
class StructType(CythonType, Generic[_T]):
def __init__(
self,
value: List[Type[_T]] = ...
) -> None: ...
#class StructType(CythonType, Generic[_T]):
# def __init__(
# self,
# value: List[Type[_T]] = ...
# ) -> None: ...
def index_type(
base_type: _T, item: Union[tuple, slice, int]) -> _ArrayType[_T]: ...
......@@ -80,7 +86,7 @@ def pointer(basetype: _T) -> Type[PointerType[_T]]: ...
def array(basetype: _T, n: int) -> Type[ArrayType[_T]]: ...
def struct(basetype: _T) -> Type[StructType[_T]]: ...
#def struct(basetype: _T) -> Type[StructType[_T]]: ...
class typedef(CythonType, Generic[_T]):
name: str
......@@ -90,7 +96,7 @@ class typedef(CythonType, Generic[_T]):
def __repr__(self) -> str: ...
__getitem__ = index_type
class _FusedType(CythonType, Genergic[_T]):
def __init__(self, Union[py_int, py_long, py_float, py_complex, Any]) -> None: ...
#class _FusedType(CythonType, Generic[_T]):
# def __init__(self) -> None: ...
def fused_type(basetype: _T) -> Type[FusedType[_T]]: ...
#def fused_type(*args: Tuple[_T]) -> Type[FusedType[_T]]: ...
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