modules: make ReturnValue.new_objects covariant
Otherwise we have to do a lot of casting to ensure that we get the
appropriate invariant type
@@ -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
