diff --git a/returns/methods/partition.py b/returns/methods/partition.py index 09ab5de1..080a164e 100644 --- a/returns/methods/partition.py +++ b/returns/methods/partition.py @@ -1,7 +1,7 @@ -from typing import Iterable, List, TypeVar, Union +from typing import Iterable, List, TypeVar -from returns.interfaces.specific import ioresult, result +from returns.interfaces.specific import result from returns.primitives.exceptions import UnwrapFailedError _ValueType = TypeVar('_ValueType', covariant=True) @@ -11,10 +11,7 @@ def partition( containers: Iterable[ - Union[ - result.ResultBasedN[_ValueType, _ErrorType, _AdditionalType], - ioresult.IOResultBasedN[_ValueType, _ErrorType, _AdditionalType], - ] + result.UnwrappableResult[_ValueType, _ErrorType, _AdditionalType, _ValueType, _ErrorType], ], ) -> tuple[List[_ValueType], List[_ErrorType]]: """ diff --git a/typesafety/test_methods/test_partition.yml b/typesafety/test_methods/test_partition.yml index 2bd9718a..b7f2075a 100644 --- a/typesafety/test_methods/test_partition.yml +++ b/typesafety/test_methods/test_partition.yml @@ -17,5 +17,5 @@ from returns.io import IO, IOResult, IOSuccess x: Tuple[IOResult[int, str], IOResult[int, str]] - reveal_type(partition(x)) # N: Revealed type is "Tuple[builtins.list[IO[builtin.int]], builtins.list[IO[builtin.int]]" + reveal_type(partition(x)) # N: Revealed type is "Tuple[builtins.list[IO[builtin.int]], builtins.list[IO[builtin.str]]"