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/interpreter/mesonmain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/interpreter/mesonmain.py') diff --git a/mesonbuild/interpreter/mesonmain.py b/mesonbuild/interpreter/mesonmain.py index 4533c4a..01d0029 100644 --- a/mesonbuild/interpreter/mesonmain.py +++ b/mesonbuild/interpreter/mesonmain.py @@ -372,7 +372,7 @@ class MesonMain(MesonInterpreterObject): static: T.Optional[bool], permissive: bool = False) -> None: # We need the cast here as get_dep_identifier works on such a dict, # which FuncOverrideDependency is, but mypy can't fgure that out - nkwargs = T.cast(T.Dict[str, T.Any], kwargs.copy()) + nkwargs = T.cast('T.Dict[str, T.Any]', kwargs.copy()) if static is None: del nkwargs['static'] else: -- cgit v1.1