diff options
| author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-09-01 19:58:10 +0200 |
|---|---|---|
| committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-09-08 20:15:58 +0200 |
| commit | e681235e5fe3ee0a40dd6a3f5922c2c4b0cf98b4 (patch) | |
| tree | 947e279889b5f7682dcd4c11beea279c24cb67bf /mesonbuild/arglist.py | |
| parent | 47373a2438c0fdeedd229b921c9d7e8dc1fc956a (diff) | |
| download | meson-e681235e5fe3ee0a40dd6a3f5922c2c4b0cf98b4.tar.gz | |
typing: fix code review
Diffstat (limited to 'mesonbuild/arglist.py')
| -rw-r--r-- | mesonbuild/arglist.py | 8 |
1 files changed, 4 insertions, 4 deletions
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): |
