aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/_typing.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-05-27 10:50:19 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2022-06-08 23:19:09 +0300
commitc51639b4ff7c37511ea74d91b2d31f5f22092bdc (patch)
tree228e72703850986b6ec1ab6b2084e75c2cfeb74d /mesonbuild/_typing.py
parent3dec0db06dfa2c73e3574ec063446c1f5da23355 (diff)
downloadmeson-c51639b4ff7c37511ea74d91b2d31f5f22092bdc.zip
meson-c51639b4ff7c37511ea74d91b2d31f5f22092bdc.tar.gz
meson-c51639b4ff7c37511ea74d91b2d31f5f22092bdc.tar.bz2
typing: replace ImmutableSetProtocol with typing.AbstractSet
Which does the same thing, but is a builtin and is more accurate
Diffstat (limited to 'mesonbuild/_typing.py')
-rw-r--r--mesonbuild/_typing.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/mesonbuild/_typing.py b/mesonbuild/_typing.py
index 7616ad6..d3cfa39 100644
--- a/mesonbuild/_typing.py
+++ b/mesonbuild/_typing.py
@@ -79,42 +79,3 @@ class ImmutableListProtocol(Protocol[T]):
def index(self, item: T) -> int: ...
def copy(self) -> typing.List[T]: ...
-
-
-class ImmutableSetProtocol(Protocol[T]):
-
- """A protocol for a set that cannot be mutated.
-
- This provides for cases where mutation of the set is undesired. Although
- this will be allowed at runtime, mypy (or another type checker), will see
- any attempt to use mutative methods as an error.
- """
-
- def __iter__(self) -> typing.Iterator[T]: ...
-
- def __contains__(self, item: T) -> bool: ...
-
- def __len__(self) -> int: ...
-
- def __add__(self, other: typing.Set[T]) -> typing.Set[T]: ...
-
- def __eq__(self, other: typing.Any) -> bool: ...
- def __ne__(self, other: typing.Any) -> bool: ...
- def __le__(self, other: typing.Any) -> bool: ...
- def __lt__(self, other: typing.Any) -> bool: ...
- def __gt__(self, other: typing.Any) -> bool: ...
- def __ge__(self, other: typing.Any) -> bool: ...
-
- def copy(self) -> typing.Set[T]: ...
-
- def difference(self, other: typing.Set[T]) -> typing.Set[T]: ...
-
- def intersection(self, other: typing.Set[T]) -> typing.Set[T]: ...
-
- def issubset(self, other: typing.Set[T]) -> bool: ...
-
- def issuperset(self, other: typing.Set[T]) -> bool: ...
-
- def symmetric_difference(self, other: typing.Set[T]) -> typing.Set[T]: ...
-
- def union(self, other: typing.Set[T]) -> typing.Set[T]: ...