diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-12 12:57:57 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-01-12 12:57:57 +0300 |
commit | 4967f628f78f7648b582a2ae705bd13aede16a76 (patch) | |
tree | 0a15cf64738cd1a63d02e030fed749e24f682c5b /algorithms/impl/quicksort.py | |
parent | fix licensing notices (diff) | |
download | sorting-algorithms-4967f628f78f7648b582a2ae705bd13aede16a76.tar.gz sorting-algorithms-4967f628f78f7648b582a2ae705bd13aede16a76.zip |
mostly Pylint fixes
Diffstat (limited to 'algorithms/impl/quicksort.py')
-rw-r--r-- | algorithms/impl/quicksort.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/algorithms/impl/quicksort.py b/algorithms/impl/quicksort.py index 3c4715a..1e835c4 100644 --- a/algorithms/impl/quicksort.py +++ b/algorithms/impl/quicksort.py @@ -69,10 +69,12 @@ _ALGORITHMS = [ SortingAlgorithm('quicksort_random', 'Quicksort (random element as pivot)', quicksort_random), ] -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(quicksort_first(list(xs))) print(quicksort_second(list(xs))) |