[mypy]Correction of all errors in the sorts directory (#4224)

* [mypy] Add/fix type annotations for recursive_insertion_sort(#4085)

* [mypy] Add/fix type annotations for bucket_sort(#4085)

* [mypy] Reworked code for cocktail_shaker_sort so that missing return statement error is resolved(#4085)

* [mypy] Add/fix type annotations for patience_sort(#4085)

* [mypy] Add/fix type annotations for radix_sort(#4085)

Co-authored-by: goodm2 <4qjpngu8mem8cz>
This commit is contained in:
Matthew
2021-02-23 09:02:30 +00:00
committed by GitHub
parent 02d9bc66c1
commit a4726ca248
5 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,7 @@
from bisect import bisect_left
from functools import total_ordering
from heapq import merge
from typing import List
"""
A pure Python implementation of the patience sort algorithm
@ -43,7 +44,7 @@ def patience_sort(collection: list) -> list:
>>> patience_sort([-3, -17, -48])
[-48, -17, -3]
"""
stacks = []
stacks: List[Stack] = []
# sort into stacks
for element in collection:
new_stacks = Stack([element])