summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-12-13 16:59:12 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-12-14 12:16:28 +0100
commit86c3709572a90911b5cb7a7347f3a08c94710ba8 (patch)
treee20312504f1f105052e8c8dba99b0fa36cef67b5
parent8eb65109cfb17e28452bd5b077d741fe077fc3d1 (diff)
downloadpylint-git-86c3709572a90911b5cb7a7347f3a08c94710ba8.tar.gz
Fix the typing of pylint.interfaces.implements
-rw-r--r--pylint/interfaces.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pylint/interfaces.py b/pylint/interfaces.py
index e8cba5e9a..0ef8cbb62 100644
--- a/pylint/interfaces.py
+++ b/pylint/interfaces.py
@@ -19,11 +19,12 @@
"""Interfaces for Pylint objects"""
from collections import namedtuple
-from typing import TYPE_CHECKING, Tuple
+from typing import TYPE_CHECKING, Tuple, Type, Union
from astroid import nodes
if TYPE_CHECKING:
+ from pylint.checkers import BaseChecker
from pylint.reporters.ureports.nodes import Section
__all__ = (
@@ -59,7 +60,10 @@ class Interface:
return implements(instance, cls)
-def implements(obj: "Interface", interface: Tuple[type, type]) -> bool:
+def implements(
+ obj: "BaseChecker",
+ interface: Union[Type["Interface"], Tuple[Type["Interface"], ...]],
+) -> bool:
"""Return whether the given object (maybe an instance or class) implements
the interface.
"""