Shadow.pyi 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. from builtins import (int as py_int, float as py_float,
  2. bool as py_bool, str as py_str, complex as py_complex)
  3. from typing import (Union, Dict, Any, Sequence, Optional,
  4. List, TypeVar, Type, Generic)
  5. int = py_int
  6. long = py_int
  7. longlong = py_int
  8. short = py_int
  9. char = py_int
  10. sint = py_int
  11. slong = py_int
  12. slonglong = py_int
  13. sshort = py_int
  14. schar = py_int
  15. uint = py_int
  16. ulong = py_int
  17. ulonglong = py_int
  18. ushort = py_int
  19. uchar = py_int
  20. size_t = py_int
  21. Py_ssize_t = py_int
  22. Py_UCS4 = Union[py_int, str]
  23. Py_UNICODE = Union[py_int, str]
  24. float = py_float
  25. double = py_float
  26. longdouble = py_float
  27. complex = py_complex
  28. floatcomplex = py_complex
  29. doublecomplex = py_complex
  30. longdoublecomplex = py_complex
  31. bint = py_bool
  32. void = Union[None]
  33. basestring = py_str
  34. unicode = py_str
  35. gs: Dict[str, Any] # Should match the return type of globals()
  36. _T = TypeVar('_T')
  37. class _ArrayType(object, Generic[_T]):
  38. is_array: bool
  39. subtypes: Sequence[str]
  40. dtype: _T
  41. ndim: int
  42. is_c_contig: bool
  43. is_f_contig: bool
  44. inner_contig: bool
  45. broadcasting: Any
  46. # broadcasting is not used, so it's not clear about its type
  47. def __init__(self, dtype: _T, ndim: int, is_c_contig: bool = ...,
  48. is_f_contig: bool = ..., inner_contig: bool = ...,
  49. broadcasting: Any = ...) -> None: ...
  50. def __repr__(self) -> str: ...
  51. class CythonTypeObject(object):
  52. ...
  53. class CythonType(CythonTypeObject):
  54. ...
  55. class PointerType(CythonType, Generic[_T]):
  56. def __init__(
  57. self,
  58. value: Optional[Union[ArrayType[_T], PointerType[_T], List[_T], int]] = ...
  59. ) -> None: ...
  60. def __getitem__(self, ix: int) -> _T: ...
  61. def __setitem__(self, ix: int, value: _T) -> None: ...
  62. def __eq__(self, value: object) -> bool: ...
  63. def __repr__(self) -> str: ...
  64. class ArrayType(PointerType[_T]):
  65. def __init__(self) -> None: ...
  66. #class StructType(CythonType, Generic[_T]):
  67. # def __init__(
  68. # self,
  69. # value: List[Type[_T]] = ...
  70. # ) -> None: ...
  71. def index_type(
  72. base_type: _T, item: Union[tuple, slice, int]) -> _ArrayType[_T]: ...
  73. def pointer(basetype: _T) -> Type[PointerType[_T]]: ...
  74. def array(basetype: _T, n: int) -> Type[ArrayType[_T]]: ...
  75. #def struct(basetype: _T) -> Type[StructType[_T]]: ...
  76. class typedef(CythonType, Generic[_T]):
  77. name: str
  78. def __init__(self, type: _T, name: Optional[str] = ...) -> None: ...
  79. def __call__(self, *arg: Any) -> _T: ...
  80. def __repr__(self) -> str: ...
  81. __getitem__ = index_type
  82. #class _FusedType(CythonType, Generic[_T]):
  83. # def __init__(self) -> None: ...
  84. #def fused_type(*args: Tuple[_T]) -> Type[FusedType[_T]]: ...