aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/algorithms/impl/selection_sort.py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-01-12 12:57:57 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-01-12 12:57:57 +0300
commit4967f628f78f7648b582a2ae705bd13aede16a76 (patch)
tree0a15cf64738cd1a63d02e030fed749e24f682c5b /algorithms/impl/selection_sort.py
parentfix licensing notices (diff)
downloadsorting-algorithms-4967f628f78f7648b582a2ae705bd13aede16a76.tar.gz
sorting-algorithms-4967f628f78f7648b582a2ae705bd13aede16a76.zip
mostly Pylint fixes
Diffstat (limited to 'algorithms/impl/selection_sort.py')
-rw-r--r--algorithms/impl/selection_sort.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/algorithms/impl/selection_sort.py b/algorithms/impl/selection_sort.py
index 0dbf4eb..ad4a420 100644
--- a/algorithms/impl/selection_sort.py
+++ b/algorithms/impl/selection_sort.py
@@ -21,10 +21,12 @@ _ALGORITHMS = [
SortingAlgorithm('selection_sort', 'Selection sort', selection_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(selection_sort(list(xs)))