You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

4 years ago
  1. from typing import (Generic, Iterable, Iterator, List, MutableSequence,
  2. Optional, TypeVar, Union)
  3. _T = TypeVar('_T')
  4. _Arg = Union[List[_T], Iterable[_T]]
  5. class FrozenList(MutableSequence[_T], Generic[_T]):
  6. def __init__(self, items: Optional[_Arg]=None) -> None: ...
  7. @property
  8. def frozen(self) -> bool: ...
  9. def freeze(self) -> None: ...
  10. def __getitem__(self, index): ...
  11. def __setitem__(self, index, value): ...
  12. def __delitem__(self, index): ...
  13. def __len__(self) -> int: ...
  14. def __iter__(self) -> Iterator[_T]: ...
  15. def __reversed__(self) -> Iterator[_T]: ...
  16. def __eq__(self, other) -> bool: ...
  17. def __le__(self, other) -> bool: ...
  18. def __ne__(self, other) -> bool: ...
  19. def __lt__(self, other) -> bool: ...
  20. def __ge__(self, other) -> bool: ...
  21. def __gt__(self, other) -> bool: ...
  22. def insert(self, pos: int, item: _T) -> None: ...
  23. def __repr__(self) -> str: ...
  24. # types for C accelerators are the same
  25. CFrozenList = PyFrozenList = FrozenList