Skip to content

Commit 982087f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 41baeb8 commit 982087f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sorts/merge_sort.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@
88
For manual testing run:
99
python merge_sort.py
1010
"""
11+
1112
from typing import Protocol, TypeVar
1213

1314
# CHANGED: Added Comparable Protocol.
1415
# WHY: Merge sort is a comparison-based sorting algorithm, so it should
1516
# support any type of item that can be compared using the < operator,
1617
# not only integers.
1718

19+
1820
class Comparable(Protocol):
1921
def __lt__(self, other: object, /) -> bool: ...
2022

23+
2124
# CHANGED: Added a TypeVar bounded to Comparable.
2225
# WHY: This preserves the input element type while ensuring that the
2326
# elements support comparison.

0 commit comments

Comments
 (0)