48445b1ef056f333fcded91c371a2230be69c2bf
[bigint-presentation-code.git] / src / bigint_presentation_code / util.pyi
1 from typing import (AbstractSet, Iterable, Iterator, Mapping,
2 MutableSet, TypeVar, overload)
3 from typing_extensions import final, Literal
4
5 _T_co = TypeVar("_T_co", covariant=True)
6 _T = TypeVar("_T")
7
8 __all__ = ["final", "Literal", "OFSet", "OSet", "FMap"]
9
10
11 class OFSet(AbstractSet[_T_co]):
12 """ ordered frozen set """
13
14 def __init__(self, items: Iterable[_T_co] = ()):
15 ...
16
17 def __contains__(self, x: object) -> bool:
18 ...
19
20 def __iter__(self) -> Iterator[_T_co]:
21 ...
22
23 def __len__(self) -> int:
24 ...
25
26 def __hash__(self) -> int:
27 ...
28
29 def __repr__(self) -> str:
30 ...
31
32
33 class OSet(MutableSet[_T]):
34 """ ordered mutable set """
35
36 def __init__(self, items: Iterable[_T] = ()):
37 ...
38
39 def __contains__(self, x: object) -> bool:
40 ...
41
42 def __iter__(self) -> Iterator[_T]:
43 ...
44
45 def __len__(self) -> int:
46 ...
47
48 def add(self, value: _T) -> None:
49 ...
50
51 def discard(self, value: _T) -> None:
52 ...
53
54 def __repr__(self) -> str:
55 ...
56
57
58 class FMap(Mapping[_T, _T_co]):
59 """ordered frozen hashable mapping"""
60 @overload
61 def __init__(self, items: Mapping[_T, _T_co] = ...): ...
62 @overload
63 def __init__(self, items: Iterable[tuple[_T, _T_co]] = ...): ...
64
65 def __getitem__(self, item: _T) -> _T_co:
66 ...
67
68 def __iter__(self) -> Iterator[_T]:
69 ...
70
71 def __len__(self) -> int:
72 ...
73
74 def __eq__(self, other: object) -> bool:
75 ...
76
77 def __hash__(self) -> int:
78 ...
79
80 def __repr__(self) -> str:
81 ...