Skip to content

Commit

Permalink
🔀 Merge pull request #56 from davep/user-methodcaller
Browse files Browse the repository at this point in the history
Use methodcaller over lambda
  • Loading branch information
davep authored Jan 9, 2025
2 parents 8cf79c4 + 97df4da commit 1f6bf57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/braindrop/app/screens/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
##############################################################################
# Python imports.
from inspect import cleandoc
from operator import methodcaller
from typing import Any
from webbrowser import open as open_url

Expand Down Expand Up @@ -139,7 +140,7 @@ def command_help(self, node: DOMNode) -> str:
if (commands := getattr(node, "COMMAND_MESSAGES", None)) is None:
return ""
keys = "| Command | Key | Description |\n| - | - | - |\n"
for command in sorted(commands, key=lambda command: command.command()):
for command in sorted(commands, key=methodcaller("command")):
keys += f"| {command.command()} | {self._all_keys(command)} | {command.tooltip()} |\n"
return f"\n\n{keys}"

Expand Down

0 comments on commit 1f6bf57

Please sign in to comment.