Skip to content

Commit 7b37a0f

Browse files
seems like that
1 parent 7a2a8fc commit 7b37a0f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

returns/methods/partition.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11

22
from typing import Iterable, List, TypeVar
33

4-
from returns.interfaces.specific import result
4+
from returns.interfaces.unwrappable import Unwrappable
55
from returns.primitives.exceptions import UnwrapFailedError
66

77
_ValueType = TypeVar('_ValueType', covariant=True)
88
_ErrorType = TypeVar('_ErrorType', covariant=True)
9-
_AdditionalType = TypeVar('_AdditionalType')
109

1110

1211
def partition(
1312
containers: Iterable[
14-
result.UnwrappableResult[_ValueType, _ErrorType, _AdditionalType, _ValueType, _ErrorType],
13+
Unwrappable[_ValueType, _ErrorType],
1514
],
1615
) -> tuple[List[_ValueType], List[_ErrorType]]:
1716
"""
@@ -28,8 +27,8 @@ def partition(
2827
([1, 3], [2, 4])
2928
3029
"""
31-
successes = []
32-
failures = []
30+
successes: list[_ValueType] = []
31+
failures: list[_ErrorType] = []
3332
for container in containers:
3433
try:
3534
successes.append(container.unwrap())

typesafety/test_methods/test_partition.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
from returns.io import IO, IOResult, IOSuccess
1818
1919
x: Tuple[IOResult[int, str], IOResult[int, str]]
20-
reveal_type(partition(x)) # N: Revealed type is "Tuple[builtins.list[IO[builtin.int]], builtins.list[IO[builtin.str]]"
20+
reveal_type(partition(x)) # N: Revealed type is "Tuple[builtins.list[returns.io.IO[builtins.int]], builtins.list[returns.io.IO[builtins.str]]]"
2121

0 commit comments

Comments
 (0)