diff options
Diffstat (limited to 'algorithms/impl/merge_sort.py')
-rw-r--r-- | algorithms/impl/merge_sort.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/algorithms/impl/merge_sort.py b/algorithms/impl/merge_sort.py index 3dd2bb9..2b96d21 100644 --- a/algorithms/impl/merge_sort.py +++ b/algorithms/impl/merge_sort.py @@ -33,10 +33,12 @@ _ALGORITHMS = [ SortingAlgorithm('merge_sort', 'Merge sort', merge_sort), ] -def _parse_args(args=sys.argv): - return list(map(int, args[1:])) +def _parse_args(args=None): + if args is None: + args = sys.argv[1:] + return list(map(int, args)) -def main(args=sys.argv): +def main(args=None): xs = _parse_args(args) print(merge_sort(list(xs))) |