From a009eacc65ddb447edcfc9fd317ad828d9b3353a Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 1 Mar 2022 23:32:14 -0500 Subject: treewide: string-quote the first argument to T.cast Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only. --- mesonbuild/linkers/linkers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/linkers/linkers.py') diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index 9cc217a..88b66be 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -1182,7 +1182,7 @@ class VisualStudioLikeLinkerMixin: def get_always_args(self) -> T.List[str]: parent = super().get_always_args() # type: ignore - return self._apply_prefix('/nologo') + T.cast(T.List[str], parent) + return self._apply_prefix('/nologo') + T.cast('T.List[str]', parent) def get_search_args(self, dirname: str) -> T.List[str]: return self._apply_prefix('/LIBPATH:' + dirname) -- cgit v1.1