From 90ce0841441506e3f409ab59ded1df8f2e6e7363 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 10 Aug 2023 21:19:29 -0400 Subject: treewide: automatic rewriting of all comment-style type annotations Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ``` --- mesonbuild/cmake/executor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mesonbuild/cmake/executor.py') diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index c22c0ca99..7958baf0c 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -39,9 +39,9 @@ if T.TYPE_CHECKING: class CMakeExecutor: # The class's copy of the CMake path. Avoids having to search for it # multiple times in the same Meson invocation. - class_cmakebin = PerMachine(None, None) # type: PerMachine[T.Optional[ExternalProgram]] - class_cmakevers = PerMachine(None, None) # type: PerMachine[T.Optional[str]] - class_cmake_cache = {} # type: T.Dict[T.Any, TYPE_result] + class_cmakebin: PerMachine[T.Optional[ExternalProgram]] = PerMachine(None, None) + class_cmakevers: PerMachine[T.Optional[str]] = PerMachine(None, None) + class_cmake_cache: T.Dict[T.Any, TYPE_result] = {} def __init__(self, environment: 'Environment', version: str, for_machine: MachineChoice, silent: bool = False): self.min_version = version @@ -50,8 +50,8 @@ class CMakeExecutor: self.cmakebin, self.cmakevers = self.find_cmake_binary(self.environment, silent=silent) self.always_capture_stderr = True self.print_cmout = False - self.prefix_paths = [] # type: T.List[str] - self.extra_cmake_args = [] # type: T.List[str] + self.prefix_paths: T.List[str] = [] + self.extra_cmake_args: T.List[str] = [] if self.cmakebin is None: return -- cgit v1.2.3