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/compilers/cpp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index a26f731..8baa727 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -622,7 +622,7 @@ class VisualStudioLikeCPPCompilerMixin(CompilerMixinBase): def get_option_link_args(self, options: 'KeyedOptionDictType') -> T.List[str]: # need a typeddict for this key = OptionKey('winlibs', machine=self.for_machine, lang=self.language) - return T.cast(T.List[str], options[key].value[:]) + return T.cast('T.List[str]', options[key].value[:]) def _get_options_impl(self, opts: 'KeyedOptionDictType', cpp_stds: T.List[str]) -> 'KeyedOptionDictType': key = OptionKey('std', machine=self.for_machine, lang=self.language) -- cgit v1.1