diff options
author | Donald Stufft <donald@stufft.io> | 2017-05-13 12:42:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-13 12:42:57 -0400 |
commit | c4cc0de249868747d82f6557077a65baae6d9f02 (patch) | |
tree | f38ad736f0b5d3b13a40fc5f39cf6839915d2056 | |
parent | ccd75d4daf7753b6587cffbb1ba52e7dfa5e9915 (diff) | |
parent | 6c201b7c8e5dd4dfd17a9326c97c693af3dc5415 (diff) | |
download | pip-c4cc0de249868747d82f6557077a65baae6d9f02.tar.gz |
Merge pull request #4477 from pradyunsg/misc-1
Use a dictionary comprehension
-rw-r--r-- | news/4477.trivial | 0 | ||||
-rw-r--r-- | pip/commands/__init__.py | 19 |
2 files changed, 2 insertions, 17 deletions
diff --git a/news/4477.trivial b/news/4477.trivial new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/news/4477.trivial diff --git a/pip/commands/__init__.py b/pip/commands/__init__.py index 62c64ebed..3b6553b33 100644 --- a/pip/commands/__init__.py +++ b/pip/commands/__init__.py @@ -16,23 +16,6 @@ from pip.commands.install import InstallCommand from pip.commands.uninstall import UninstallCommand from pip.commands.wheel import WheelCommand - -commands_dict = { - CompletionCommand.name: CompletionCommand, - FreezeCommand.name: FreezeCommand, - HashCommand.name: HashCommand, - HelpCommand.name: HelpCommand, - SearchCommand.name: SearchCommand, - ShowCommand.name: ShowCommand, - InstallCommand.name: InstallCommand, - UninstallCommand.name: UninstallCommand, - DownloadCommand.name: DownloadCommand, - ListCommand.name: ListCommand, - CheckCommand.name: CheckCommand, - WheelCommand.name: WheelCommand, -} - - commands_order = [ InstallCommand, DownloadCommand, @@ -48,6 +31,8 @@ commands_order = [ HelpCommand, ] +commands_dict = {c.name: c for c in commands_order} + def get_summaries(ordered=True): """Yields sorted (command name, command summary) tuples.""" |