diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-31 21:03:40 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-01-10 18:36:57 -0500 |
commit | 98a41ec24e77d7670ea83fd986853d0fe7cb2f5b (patch) | |
tree | 9f6d4ed1a0d585f106ddfd84288ed6981ce7c9a3 /mesonbuild | |
parent | 140097faf0eddcc7819a3353eb7c21b82a7df1e0 (diff) | |
download | meson-98a41ec24e77d7670ea83fd986853d0fe7cb2f5b.zip meson-98a41ec24e77d7670ea83fd986853d0fe7cb2f5b.tar.gz meson-98a41ec24e77d7670ea83fd986853d0fe7cb2f5b.tar.bz2 |
manually clean up some python 3.6 era code
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/mesonlib/universal.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index 493acef..1e3f54e 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -1708,9 +1708,7 @@ class OrderedSet(T.MutableSet[_T]): insertion. """ def __init__(self, iterable: T.Optional[T.Iterable[_T]] = None): - # typing.OrderedDict is new in 3.7.2, so we can't use that, but we can - # use MutableMapping, which is fine in this case. - self.__container = collections.OrderedDict() # type: T.MutableMapping[_T, None] + self.__container: T.OrderedDict[_T, None] = collections.OrderedDict() if iterable: self.update(iterable) @@ -1741,12 +1739,10 @@ class OrderedSet(T.MutableSet[_T]): del self.__container[value] def move_to_end(self, value: _T, last: bool = True) -> None: - # Mypy does not know about move_to_end, because it is not part of MutableMapping - self.__container.move_to_end(value, last) # type: ignore + self.__container.move_to_end(value, last) def pop(self, last: bool = True) -> _T: - # Mypy does not know about the last argument, because it is not part of MutableMapping - item, _ = self.__container.popitem(last) # type: ignore + item, _ = self.__container.popitem(last) return item def update(self, iterable: T.Iterable[_T]) -> None: |