Skip to content

Commit 251c7d0

Browse files
committed
sorts: add doctest for mixed-type input
1 parent a5b9815 commit 251c7d0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎sorts/adaptive_merge_sort.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ def adaptive_merge_sort[T: Comparable](sequence: list[T]) -> list[T]:
2828
['a', 'b', 'c']
2929
>>> adaptive_merge_sort([2.5, -1.0, 0.0])
3030
[-1.0, 0.0, 2.5]
31+
>>> adaptive_merge_sort([1, "a"])
32+
Traceback (most recent call last):
33+
...
34+
TypeError: '<' not supported between instances of 'str' and 'int'
3135
"""
3236
if len(sequence) < 2:
3337
return sequence

0 commit comments

Comments
 (0)