Skip to content

Commit f0ee4e8

Browse files
committed
Fixed multiple issues I missed in the typesafety tests update
1 parent be9c23b commit f0ee4e8

32 files changed

+117
-115
lines changed

typesafety/test_curry/test_curry/test_curry_generics.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
T = TypeVar('T')
88
99
@curry
10-
def zero(arg: List[T]) -> T:
10+
def zero(arg: list[T]) -> T:
1111
...
1212
13-
x: List[int]
13+
x: list[int]
1414
1515
reveal_type(zero) # N: Revealed type is "def [T] (arg: builtins.list[T`-1]) -> T`-1"
1616
reveal_type(zero(x)) # N: Revealed type is "builtins.int"
@@ -25,10 +25,10 @@
2525
T = TypeVar('T')
2626
2727
@curry
28-
def zero(arg: List[T], other: int) -> T:
28+
def zero(arg: list[T], other: int) -> T:
2929
...
3030
31-
x: List[int]
31+
x: list[int]
3232
3333
reveal_type(zero) # N: Revealed type is "Overload(def [T] (arg: builtins.list[T`-1]) -> def (other: builtins.int) -> T`-1, def [T] (arg: builtins.list[T`-1], other: builtins.int) -> T`-1)"
3434
reveal_type(zero(x)) # N: Revealed type is "def (other: builtins.int) -> builtins.int"
@@ -45,11 +45,11 @@
4545
T = TypeVar('T')
4646
4747
@curry
48-
def zero(arg: int, other: List[T]) -> T:
48+
def zero(arg: int, other: list[T]) -> T:
4949
...
5050
51-
x: List[int]
52-
y: List[str]
51+
x: list[int]
52+
y: list[str]
5353
5454
reveal_type(zero(1)(x)) # N: Revealed type is "builtins.int"
5555
reveal_type(zero(1, x)) # N: Revealed type is "builtins.int"
@@ -67,10 +67,10 @@
6767
T = TypeVar('T')
6868
6969
@curry
70-
def zero(arg: T, other: List[T]) -> T:
70+
def zero(arg: T, other: list[T]) -> T:
7171
...
7272
73-
x: List[int]
73+
x: list[int]
7474
7575
reveal_type(zero) # N: Revealed type is "Overload(def [T] (arg: T`-1) -> def [T] (other: builtins.list[T`-1]) -> T`-1, def [T] (arg: T`-1, other: builtins.list[T`-1]) -> T`-1)"
7676
reveal_type(zero(1)) # N: Revealed type is "def [T] (other: builtins.list[T`2]) -> T`2"

typesafety/test_curry/test_partial/test_partial_arguments.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
def __call__(self, arg: int, other: str) -> None:
136136
...
137137
138-
x: Union[Inst, Other]
138+
x: Inst | Other
139139
reveal_type(partial(x))
140140
# This does not work as well:
141141
reveal_type(partial(x, 1))

typesafety/test_curry/test_partial/test_partial_generic.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
T = TypeVar('T')
88
99
def multiple(
10-
a: List[T],
11-
b: List[T],
10+
a: list[T],
11+
b: list[T],
1212
) -> T:
1313
...
1414
15-
x: List[int]
16-
y: List[str]
15+
x: list[int]
16+
y: list[str]
1717
1818
reveal_type(partial(multiple, x)(y))
1919
out: |
@@ -30,13 +30,13 @@
3030
T = TypeVar('T')
3131
3232
def multiple(
33-
a: List[T],
34-
b: List[T],
33+
a: list[T],
34+
b: list[T],
3535
) -> T:
3636
...
3737
38-
x: List[int]
39-
y: List[int]
38+
x: list[int]
39+
y: list[int]
4040
4141
reveal_type(partial(multiple, x)(y))
4242
out: |
@@ -53,12 +53,12 @@
5353
5454
def multiple(
5555
a: int,
56-
b: List[T],
56+
b: list[T],
5757
c: bool = False,
5858
) -> T:
5959
...
6060
61-
x: List[int]
61+
x: list[int]
6262
6363
reveal_type(partial(multiple))
6464
reveal_type(partial(multiple, 1))
@@ -91,13 +91,13 @@
9191
def multiple(
9292
a: int,
9393
*,
94-
b: List[B],
95-
c: List[A],
96-
) -> Union[A, B]:
94+
b: list[B],
95+
c: list[A],
96+
) -> A | B:
9797
...
9898
99-
x: List[int]
100-
y: List[str]
99+
x: list[int]
100+
y: list[str]
101101
102102
reveal_type(partial(multiple))
103103
reveal_type(partial(multiple, 1))
@@ -126,13 +126,13 @@
126126
def multiple(
127127
a: int,
128128
*,
129-
b: List[B],
130-
c: List[A],
131-
) -> Union[A, B]:
129+
b: list[B],
130+
c: list[A],
131+
) -> A | B:
132132
...
133133
134-
x: List[int]
135-
y: List[str]
134+
x: list[int]
135+
y: list[str]
136136
reveal_type(partial(multiple, 1, c=y, b=x))
137137
138138
reveal_type(partial(multiple, 1, b=x)(c=y))

typesafety/test_curry/test_partial/test_partial_overload.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,22 @@
9393
T = TypeVar('T')
9494
9595
@overload
96-
def two_args(a: int, b: List[T]) -> T:
96+
def two_args(a: int, b: list[T]) -> T:
9797
...
9898
9999
@overload
100-
def two_args(a: int, b: Set[T]) -> T:
100+
def two_args(a: int, b: set[T]) -> T:
101101
...
102102
103103
@overload
104-
def two_args(a: List[T], b: Set[T]) -> T:
104+
def two_args(a: list[T], b: set[T]) -> T:
105105
...
106106
107107
def two_args(a, b):
108108
...
109109
110-
x: List[float]
111-
y: Set[float]
110+
x: list[float]
111+
y: set[float]
112112
113113
reveal_type(partial(two_args))
114114
reveal_type(partial(two_args, 1))
@@ -135,22 +135,22 @@
135135
B = TypeVar('B')
136136
137137
@overload
138-
def two_args(a: int, b: List[A]) -> A:
138+
def two_args(a: int, b: list[A]) -> A:
139139
...
140140
141141
@overload
142-
def two_args(a: int, b: List[B]) -> B:
142+
def two_args(a: int, b: list[B]) -> B:
143143
...
144144
145145
@overload
146-
def two_args(a: List[A], b: List[B]) -> Union[A, B]:
146+
def two_args(a: list[A], b: list[B]) -> A | B:
147147
...
148148
149149
def two_args(a, b):
150150
...
151151
152-
a: List[float]
153-
b: List[str]
152+
a: list[float]
153+
b: list[str]
154154
155155
reveal_type(partial(two_args))
156156
reveal_type(partial(two_args, 1))

typesafety/test_examples/test_your_container/test_pair4_def.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
my_pair: Pair[int, str] = Pair.from_paired(1, 'a')
1616
reveal_type(my_pair.pair(function))
1717
out: |
18-
main:4: note: Revealed type is "Any"
19-
main:10: note: Revealed type is "Any"
18+
main:4: note: Revealed type is "def [_FirstType, _SecondType] (inner_value: tuple[_FirstType`1, _SecondType`2]) -> test_pair4.Pair[_FirstType`1, _SecondType`2]"
19+
main:10: note: Revealed type is "test_pair4.Pair[builtins.float, builtins.bool]"

typesafety/test_examples/test_your_container/test_pair4_reuse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
reveal_type(my_pair.map(str))
1212
reveal_type(map_(str)(my_pair))
1313
out: |
14-
main:5: note: Revealed type is "Any"
15-
main:6: note: Revealed type is "Any"
14+
main:5: note: Revealed type is "test_pair4.Pair[builtins.str, builtins.int]"
15+
main:6: note: Revealed type is "test_pair4.Pair[builtins.str, builtins.int]"

typesafety/test_functions/test_not_.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from returns.functions import not_
1515
from typing import List
1616
17-
def number_is_in_list(number: int, list_: List[int]) -> bool:
17+
def number_is_in_list(number: int, list_: list[int]) -> bool:
1818
return number in list_
1919
2020
reveal_type(not_(number_is_in_list)) # N: Revealed type is "def (number: builtins.int, list_: builtins.list[builtins.int]) -> builtins.bool"

typesafety/test_interfaces/test_specific/test_future/test_futurelike_inheritance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
...
5656
5757
x: Future[int]
58-
reveal_type(MyClass.from_future(x).bind_future(test1).bind_async_future(test2).bind_async(test3)) # N: Revealed type is "tmp1_9rpu4l.MyClass[builtins.str]"
58+
reveal_type(MyClass.from_future(x).bind_future(test1).bind_async_future(test2).bind_async(test3)) # N: Revealed type is "main.MyClass[builtins.str]"
5959
6060
6161
- case: future_inheritance_correct2

typesafety/test_interfaces/test_specific/test_future_result/test_future_result_like.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
...
4242
4343
x: MyClass[int, str]
44-
reveal_type(x.bind_future_result(test)) # N: Revealed type is "tmp417ocr_v.MyClass[builtins.float, builtins.str]"
44+
reveal_type(x.bind_future_result(test)) # N: Revealed type is "main.MyClass[builtins.float, builtins.str]"
4545
4646
4747
- case: future_result_inheritance_missing

typesafety/test_interfaces/test_specific/test_io/test_io_like.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
main:15: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
8484
main:19: error: Signature of "from_io" incompatible with supertype "returns.interfaces.specific.io.IOLikeN" [override]
8585
main:19: note: Superclass:
86+
main:19: note: @classmethod
8687
main:19: note: def [_UpdatedType] from_io(cls, inner_value: IO[_UpdatedType]) -> KindN[MyClass[_ValueType], _UpdatedType, Never, Never]
8788
main:19: note: Subclass:
8889
main:19: note: def [_NewValueType] from_io(self, inner_value: IO[_NewValueType]) -> MyClass[_NewValueType]

0 commit comments

Comments
 (0)