Skip to content

Commit d42cd73

Browse files
committed
arglist: Fix remaining mypy errors and warnings
So we can lint it with mypy
1 parent 4f6bd29 commit d42cd73

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/lint_mypy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
with:
3232
python-version: '3.x'
3333
- run: python -m pip install mypy
34-
- run: mypy --follow-imports=skip mesonbuild/interpreterbase.py mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/mintro.py mesonbuild/mparser.py mesonbuild/msetup.py mesonbuild/ast mesonbuild/wrap tools/ mesonbuild/modules/fs.py mesonbuild/dependencies/boost.py mesonbuild/dependencies/mpi.py mesonbuild/dependencies/hdf5.py mesonbuild/compilers/mixins/intel.py mesonbuild/mlog.py mesonbuild/mcompile.py mesonbuild/mesonlib.py
34+
- run: mypy --follow-imports=skip mesonbuild/interpreterbase.py mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/mintro.py mesonbuild/mparser.py mesonbuild/msetup.py mesonbuild/ast mesonbuild/wrap tools/ mesonbuild/modules/fs.py mesonbuild/dependencies/boost.py mesonbuild/dependencies/mpi.py mesonbuild/dependencies/hdf5.py mesonbuild/compilers/mixins/intel.py mesonbuild/mlog.py mesonbuild/mcompile.py mesonbuild/mesonlib.py mesonbuild/arglist.py

mesonbuild/arglist.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from .linkers import StaticLinker
2727
from .compilers import Compiler
2828

29-
3029
UNIXY_COMPILER_INTERNAL_LIBS = ['m', 'c', 'pthread', 'dl', 'rt'] # type: T.List[str]
3130
# execinfo is a compiler lib on FreeBSD and NetBSD
3231
if mesonlib.is_freebsd() or mesonlib.is_netbsd():
@@ -158,8 +157,8 @@ def __iter__(self) -> T.Iterator[str]:
158157
def __getitem__(self, index: int) -> str: # noqa: F811
159158
pass
160159

161-
@T.overload # noqa: F811
162-
def __getitem__(self, index: slice) -> T.List[str]: # noqa: F811
160+
@T.overload # noqa: F811
161+
def __getitem__(self, index: slice) -> T.MutableSequence[str]: # noqa: F811
163162
pass
164163

165164
def __getitem__(self, index): # noqa: F811
@@ -171,7 +170,7 @@ def __setitem__(self, index: int, value: str) -> None: # noqa: F811
171170
pass
172171

173172
@T.overload # noqa: F811
174-
def __setitem__(self, index: slice, value: T.List[str]) -> None: # noqa: F811
173+
def __setitem__(self, index: slice, value: T.Iterable[str]) -> None: # noqa: F811
175174
pass
176175

177176
def __setitem__(self, index, value) -> None: # noqa: F811
@@ -312,7 +311,7 @@ def __radd__(self, args: T.Iterable[str]) -> 'CompilerArgs':
312311
new += self
313312
return new
314313

315-
def __eq__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
314+
def __eq__(self, other: T.Any) -> T.Union[bool]:
316315
self.flush_pre_post()
317316
# Only allow equality checks against other CompilerArgs and lists instances
318317
if isinstance(other, CompilerArgs):

0 commit comments

Comments
 (0)