From e681235e5fe3ee0a40dd6a3f5922c2c4b0cf98b4 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 1 Sep 2020 19:58:10 +0200 Subject: typing: fix code review --- mesonbuild/arglist.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mesonbuild/arglist.py') diff --git a/mesonbuild/arglist.py b/mesonbuild/arglist.py index d88438957..d1d489bfd 100644 --- a/mesonbuild/arglist.py +++ b/mesonbuild/arglist.py @@ -164,7 +164,7 @@ class CompilerArgs(collections.abc.MutableSequence): def __getitem__(self, index: slice) -> T.MutableSequence[str]: # noqa: F811 pass - def __getitem__(self, index): # type: ignore # noqa: F811 + def __getitem__(self, index: T.Union[int, slice]) -> T.Union[str, T.MutableSequence[str]]: # noqa: F811 self.flush_pre_post() return self._container[index] @@ -176,9 +176,9 @@ class CompilerArgs(collections.abc.MutableSequence): def __setitem__(self, index: slice, value: T.Iterable[str]) -> None: # noqa: F811 pass - def __setitem__(self, index, value) -> None: # type: ignore # noqa: F811 + def __setitem__(self, index: T.Union[int, slice], value: T.Union[str, T.Iterable[str]]) -> None: # noqa: F811 self.flush_pre_post() - self._container[index] = value + self._container[index] = value # type: ignore # TODO: fix 'Invalid index type' and 'Incompatible types in assignment' erros def __delitem__(self, index: T.Union[int, slice]) -> None: self.flush_pre_post() @@ -314,7 +314,7 @@ class CompilerArgs(collections.abc.MutableSequence): new += self return new - def __eq__(self, other: T.Any) -> T.Union[bool]: + def __eq__(self, other: object) -> T.Union[bool]: self.flush_pre_post() # Only allow equality checks against other CompilerArgs and lists instances if isinstance(other, CompilerArgs): -- cgit v1.2.3