Skip to content

Commit 275bed0

Browse files
authored
Pyupgrade (#1972)
1 parent 28f14f8 commit 275bed0

File tree

120 files changed

+400
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+400
-481
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
strategy:
7474
fail-fast: false
7575
matrix:
76-
python-version: ['3.9', '3.10', '3.11', '3.12']
76+
python-version: ['3.10', '3.11', '3.12', '3.13']
7777
shard: [0, 1, 2, 3]
7878

7979
steps:

returns/_internal/futures/_future.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import TYPE_CHECKING, Awaitable, Callable, TypeVar
1+
from collections.abc import Awaitable, Callable
2+
from typing import TYPE_CHECKING, TypeVar
23

34
from returns.io import IO
45
from returns.primitives.hkt import Kind1, dekind

returns/_internal/futures/_future_result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import TYPE_CHECKING, Any, Awaitable, Callable, TypeVar
1+
from collections.abc import Awaitable, Callable
2+
from typing import TYPE_CHECKING, Any, TypeVar
23

34
from returns.io import IO, IOResult
45
from returns.primitives.hkt import Kind2, dekind

returns/_internal/futures/_reader_future_result.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import TYPE_CHECKING, Awaitable, Callable, TypeVar
1+
from collections.abc import Awaitable, Callable
2+
from typing import TYPE_CHECKING, TypeVar
23

34
from returns.primitives.hkt import Kind3, dekind
45
from returns.result import Result, Success

returns/_internal/pipeline/managed.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Callable, TypeVar
1+
from collections.abc import Callable
2+
from typing import TypeVar
23

34
from returns.interfaces.specific.ioresult import IOResultLikeN
45
from returns.primitives.hkt import Kinded, KindN, kinded

returns/context/requires_context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, TypeVar, final
4-
5-
from typing_extensions import TypeAlias
3+
from collections.abc import Callable
4+
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias, TypeVar, final
65

76
from returns.functions import identity
87
from returns.future import FutureResult

returns/context/requires_context_future_result.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import (
4-
TYPE_CHECKING,
5-
Any,
6-
Awaitable,
7-
Callable,
8-
ClassVar,
9-
TypeVar,
10-
final,
11-
)
12-
13-
from typing_extensions import TypeAlias
3+
from collections.abc import Awaitable, Callable
4+
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias, TypeVar, final
145

156
from returns._internal.futures import _reader_future_result
167
from returns.context import NoDeps

returns/context/requires_context_ioresult.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, TypeVar, final
4-
5-
from typing_extensions import TypeAlias
3+
from collections.abc import Callable
4+
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias, TypeVar, final
65

76
from returns.context import NoDeps
87
from returns.interfaces.specific import reader_ioresult

returns/context/requires_context_result.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, TypeVar, final
4-
5-
from typing_extensions import TypeAlias
3+
from collections.abc import Callable
4+
from typing import TYPE_CHECKING, Any, ClassVar, TypeAlias, TypeVar, final
65

76
from returns.context import NoDeps
87
from returns.interfaces.specific import reader_result

returns/contrib/hypothesis/_entrypoint.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
from __future__ import annotations
1212

13-
from typing import TYPE_CHECKING, Any, Callable, Sequence, Type, TypeVar
13+
from collections.abc import Callable, Sequence
14+
from typing import TYPE_CHECKING, Any, TypeVar
1415

1516
if TYPE_CHECKING:
1617
from returns.primitives.laws import Lawful
@@ -33,7 +34,7 @@ def _setup_hook() -> None:
3334
from returns.result import Result
3435

3536
def factory(
36-
container_type: Type[_Inst],
37+
container_type: type[_Inst],
3738
) -> Callable[[Any], st.SearchStrategy[_Inst]]:
3839
def decorator(thing: Any) -> st.SearchStrategy[_Inst]:
3940
from returns.contrib.hypothesis.containers import (
@@ -44,7 +45,7 @@ def decorator(thing: Any) -> st.SearchStrategy[_Inst]:
4445

4546
#: Our types that we register in hypothesis
4647
#: to be working with ``st.from_type``
47-
registered_types: Sequence[Type[Lawful]] = (
48+
registered_types: Sequence[type[Lawful]] = (
4849
Result,
4950
Maybe,
5051
IO,

0 commit comments

Comments
 (0)