From 401778e7b7d4f629417a1b613ec36f4b21c1508e Mon Sep 17 00:00:00 2001 From: mimir-d Date: Fri, 25 Oct 2024 16:53:48 +0100 Subject: [PATCH] add callable type to demo decorator - use collections.abc.Callable for `demo` typing Signed-off-by: mimir-d --- examples/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/__init__.py b/examples/__init__.py index b49f3dd..d1fbea4 100644 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -1,8 +1,10 @@ +import collections.abc as abc + DEMOS = {} -def demo(func): - def w(banner=True): +def demo(func) -> abc.Callable[[], None]: + def w(banner=True) -> None: if banner: print("-" * 80) print(func.__name__)