From bd5340fa8195c41caeaaa539d49ebfdeeae3a8df Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Tue, 2 Aug 2022 09:23:34 +0200 Subject: More explicit typehinting --- hazwaz/command.py | 4 ++-- hazwaz/mixins.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hazwaz/command.py b/hazwaz/command.py index 1faf0fa..df8c186 100644 --- a/hazwaz/command.py +++ b/hazwaz/command.py @@ -35,11 +35,11 @@ class MainCommand: MyCommand().run() ''' - commands = () + commands: typing.Iterable["Command"] = () """ The subcommands: a tuple of :py:class:`Command` subclasses. """ - logformat = "%(levelname)s:%(name)s: %(message)s" + logformat: str = "%(levelname)s:%(name)s: %(message)s" """ The format passed to logging.Formatter. """ diff --git a/hazwaz/mixins.py b/hazwaz/mixins.py index 5a02238..443927d 100644 --- a/hazwaz/mixins.py +++ b/hazwaz/mixins.py @@ -24,7 +24,7 @@ class ExternalEditorMixin: ("vi", "vi"), ] - def edit_file_in_external_editor(self, filepath): + def edit_file_in_external_editor(self, filepath: str) -> bool: """ Open filepath in an external editor and wait for it to be closed. -- cgit v1.2.3