Skip to content

Commit beac335

Browse files
authored
Merge branch 'master' into fix/odd-even-parallel-comparable
2 parents 80482c3 + 215c1f0 commit beac335

4 files changed

Lines changed: 9 additions & 18 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ repos:
2929
- tomli
3030

3131
- repo: https://github.com/tox-dev/pyproject-fmt
32-
rev: v2.29.4
32+
rev: v2.30.1
3333
hooks:
3434
- id: pyproject-fmt
3535

3636
- repo: https://github.com/astral-sh/ruff-pre-commit
37-
rev: v0.16.7
37+
rev: v0.16.10
3838
hooks:
3939
- id: ruff-check
4040
- id: ruff-format
4141

4242
- repo: https://github.com/rvben/rumdl-pre-commit
43-
rev: v0.2.73
43+
rev: v0.2.78
4444
hooks:
4545
- id: rumdl-fmt
4646
- id: rumdl
@@ -55,7 +55,7 @@ repos:
5555
pass_filenames: false
5656

5757
- repo: https://github.com/astral-sh/uv-pre-commit
58-
rev: 0.12.13
58+
rev: 0.12.23
5959
hooks:
6060
- id: uv-lock
6161

@@ -65,7 +65,7 @@ repos:
6565
- id: validate-pyproject
6666

6767
- repo: https://github.com/15r10nk/matchify
68-
rev: v0.2.0
68+
rev: v0.3.0
6969
hooks:
7070
- id: matchify
7171
exclude: ^data_structures/linked_list/doubly_linked_list\.py$

‎sorts/binary_insertion_sort.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
python binary_insertion_sort.py
1111
"""
1212

13-
from typing import Protocol, TypeVar
13+
from typing import Protocol
1414

1515

1616
class Comparable(Protocol):
1717
def __lt__(self, other: object, /) -> bool: ...
1818

1919

20-
T = TypeVar("T", bound=Comparable)
21-
22-
2320
def binary_insertion_sort[T: Comparable](collection: list[T]) -> list[T]:
2421
"""
2522
Sorts a list using the binary insertion sort algorithm.

‎sorts/pancake_sort.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@
2121
"""
2222

2323
from collections.abc import Sequence
24-
from typing import Any, Protocol, TypeVar
24+
from typing import Any, Protocol
2525

2626

2727
class Comparable(Protocol):
2828
def __lt__(self, other: Any, /) -> bool: ...
2929

3030

31-
T = TypeVar("T", bound=Comparable)
32-
33-
3431
def pancake_sort[T: Comparable](arr: Sequence[T]) -> list[T]:
3532
"""Sort Array with Pancake Sort.
3633

‎sorts/strand_sort.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import operator
2-
from typing import Protocol, TypeVar
2+
from typing import Protocol
33

44

55
class Comparable(Protocol):
@@ -8,10 +8,7 @@ def __lt__(self, other: object, /) -> bool: ...
88
def __gt__(self, other: object, /) -> bool: ...
99

1010

11-
T = TypeVar("T", bound=Comparable)
12-
13-
14-
def strand_sort[T](
11+
def strand_sort[T: Comparable](
1512
arr: list[T], reverse: bool = False, solution: list[T] | None = None
1613
) -> list[T]:
1714
"""

0 commit comments

Comments
 (0)