Skip to content

Commit 81fcb90

Browse files
Add type hints for bogo_sort.py (#14306)
* Added type hints for bogo_sort * Update bogo_sort.py --------- Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
1 parent 0324e60 commit 81fcb90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sorts/bogo_sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import random
1717

1818

19-
def bogo_sort(collection):
19+
def bogo_sort(collection: list) -> list:
2020
"""Pure implementation of the bogosort algorithm in Python
2121
:param collection: some mutable ordered collection with heterogeneous
2222
comparable items inside
@@ -30,7 +30,7 @@ def bogo_sort(collection):
3030
[-45, -5, -2]
3131
"""
3232

33-
def is_sorted(collection):
33+
def is_sorted(collection: list) -> bool:
3434
for i in range(len(collection) - 1):
3535
if collection[i] > collection[i + 1]:
3636
return False

0 commit comments

Comments
 (0)