From 88bd9867400e25b9ce268c8fc3f15ae51ffc56a4 Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Fri, 2 Sep 2022 17:12:31 -0700 Subject: [PATCH] use isclass instead of `not isfunction` It is not always true that `not isfunction(...) is isclass(...)` --- src/flake8/plugins/finder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flake8/plugins/finder.py b/src/flake8/plugins/finder.py index c051488..8852ef2 100644 --- a/src/flake8/plugins/finder.py +++ b/src/flake8/plugins/finder.py @@ -272,7 +272,7 @@ def _parameters_for(func: Any) -> dict[str, bool]: A dictionary mapping the parameter name to whether or not it is required (a.k.a., is positional only/does not have a default). """ - is_class = not inspect.isfunction(func) + is_class = inspect.isclass(func) if is_class: func = func.__init__