From 03aaedc3eb6473987cb1676e1084f0bea0a7d0c8 Mon Sep 17 00:00:00 2001 From: "Pradyun S. Gedam" Date: Sat, 13 May 2017 15:56:22 +0530 Subject: Use a dictionary comprehension All supported versions of likely support this construct. Please correct me if I'm wrong though. --- pip/commands/__init__.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) 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.""" -- cgit v1.2.1 From 6c201b7c8e5dd4dfd17a9326c97c693af3dc5415 Mon Sep 17 00:00:00 2001 From: "Pradyun S. Gedam" Date: Sat, 13 May 2017 15:59:13 +0530 Subject: New entry --- news/4477.trivial | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 news/4477.trivial diff --git a/news/4477.trivial b/news/4477.trivial new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.1