Skip to content

Commit 0784de7

Browse files
committed
Add type annotations to merge_sort
1 parent 678dedb commit 0784de7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sorts/merge_sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111

1212

13-
def merge_sort(collection: list) -> list:
13+
def merge_sort(collection: list[int]) -> list[int]:
1414
"""
1515
Sorts a list using the merge sort algorithm.
1616
@@ -29,7 +29,7 @@ def merge_sort(collection: list) -> list:
2929
[-45, -5, -2]
3030
"""
3131

32-
def merge(left: list, right: list) -> list:
32+
def merge(left: list[int], right: list[int]) -> list[int]:
3333
"""
3434
Merge two sorted lists into a single sorted list.
3535

0 commit comments

Comments
 (0)