Skip to content

Commit 8cfd825

Browse files
committed
[mypy] Add/fix type annotations for patience_sort(TheAlgorithms#4085)
1 parent 82b8a74 commit 8cfd825

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sorts/patience_sort.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from bisect import bisect_left
22
from functools import total_ordering
33
from heapq import merge
4+
from typing import List
45

56
"""
67
A pure Python implementation of the patience sort algorithm
@@ -43,7 +44,7 @@ def patience_sort(collection: list) -> list:
4344
>>> patience_sort([-3, -17, -48])
4445
[-48, -17, -3]
4546
"""
46-
stacks = []
47+
stacks: List[Stack] = []
4748
# sort into stacks
4849
for element in collection:
4950
new_stacks = Stack([element])

0 commit comments

Comments
 (0)