diff options
| author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-06-25 03:52:03 +0300 |
|---|---|---|
| committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-06-25 03:52:03 +0300 |
| commit | 9f2ba1c91526e84eb24a38128f8c71d628d1091e (patch) | |
| tree | b0dcc199af4142122701b108c8359af7f17dd53b | |
| parent | README update (diff) | |
| download | sorting-algorithms-9f2ba1c91526e84eb24a38128f8c71d628d1091e.tar.gz sorting-algorithms-9f2ba1c91526e84eb24a38128f8c71d628d1091e.zip | |
sort algorithms in usage messages
| -rw-r--r-- | plot.py | 3 | ||||
| -rw-r--r-- | test.py | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -51,7 +51,8 @@ def _format_algorithm(codename): def _format_available_algorithms(): descr = 'available algorithms (in the CODENAME: DISPLAY_NAME format):\n' - return descr + '\n'.join(map(_format_algorithm, registry.get_codenames())) + return descr + '\n'.join(map( + _format_algorithm, sorted(registry.get_codenames()))) def _format_description(): return _format_available_algorithms() @@ -38,7 +38,8 @@ def _format_algorithm(codename): def _format_available_algorithms(): descr = 'available algorithms (in the CODENAME: DISPLAY_NAME format):\n' - return descr + '\n'.join(map(_format_algorithm, registry.get_codenames())) + return descr + '\n'.join(map( + _format_algorithm, sorted(registry.get_codenames()))) def _format_description(): return _format_available_algorithms() |
