Skip to content

Commit b75a7c7

Browse files
authored
pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0 (TheAlgorithms#6245)
* pre-commit autoupdate: pyupgrade v2.34.0 -> v2.37.0 * pre-commit run --all-files
1 parent 2d5dd6f commit b75a7c7

Some content is hidden

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

41 files changed

+56
-41
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ repos:
2626
- --profile=black
2727

2828
- repo: https://github.com/asottile/pyupgrade
29-
rev: v2.34.0
29+
rev: v2.37.0
3030
hooks:
3131
- id: pyupgrade
3232
args:

arithmetic_analysis/bisection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable
1+
from collections.abc import Callable
22

33

44
def bisection(function: Callable[[float], float], a: float, b: float) -> float:

arithmetic_analysis/intersection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import math
2-
from typing import Callable
2+
from collections.abc import Callable
33

44

55
def intersection(function: Callable[[float], float], x0: float, x1: float) -> float:

arithmetic_analysis/newton_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Newton's Method."""
22

33
# Newton's Method - https://en.wikipedia.org/wiki/Newton%27s_method
4-
from typing import Callable
4+
from collections.abc import Callable
55

66
RealFunc = Callable[[float], float] # type alias for a real -> real function
77

boolean_algebra/quine_mc_cluskey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Sequence
3+
from collections.abc import Sequence
44

55

66
def compare_string(string1: str, string2: str) -> str:

ciphers/playfair_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import itertools
22
import string
3-
from typing import Generator, Iterable
3+
from collections.abc import Generator, Iterable
44

55

66
def chunker(seq: Iterable[str], size: int) -> Generator[tuple[str, ...], None, None]:

computer_vision/horn_schunck.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
Paper: http://image.diku.dk/imagecanon/material/HornSchunckOptical_Flow.pdf
1010
"""
1111

12+
from typing import SupportsIndex
13+
1214
import numpy as np
1315
from scipy.ndimage.filters import convolve
14-
from typing_extensions import SupportsIndex
1516

1617

1718
def warp(

data_structures/binary_tree/binary_search_tree_recursive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from __future__ import annotations
1111

1212
import unittest
13-
from typing import Iterator
13+
from collections.abc import Iterator
1414

1515

1616
class Node:

data_structures/binary_tree/binary_tree_traversals.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
from __future__ import annotations
33

44
from collections import deque
5+
from collections.abc import Sequence
56
from dataclasses import dataclass
6-
from typing import Any, Sequence
7+
from typing import Any
78

89

910
@dataclass

data_structures/binary_tree/non_recursive_segment_tree.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"""
3838
from __future__ import annotations
3939

40-
from typing import Any, Callable, Generic, TypeVar
40+
from collections.abc import Callable
41+
from typing import Any, Generic, TypeVar
4142

4243
T = TypeVar("T")
4344

0 commit comments

Comments
 (0)