From c4aa8c2521101e16ffb3da3a47334e18672abdda Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 30 Sep 2021 09:19:49 -0700 Subject: [PATCH] modules: make ReturnValue.new_objects covariant Otherwise we have to do a lot of casting to ensure that we get the appropriate invariant type --- mesonbuild/modules/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 0129909a5..74fe145d2 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -185,7 +185,7 @@ def is_module_library(fname): class ModuleReturnValue: - def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.List['TYPE_var']) -> None: + def __init__(self, return_value: T.Optional['TYPE_var'], new_objects: T.Sequence['TYPE_var']) -> None: self.return_value = return_value assert isinstance(new_objects, list) self.new_objects = new_objects