Skip to content

Commit 86c3709

Browse files
Fix the typing of pylint.interfaces.implements
1 parent 8eb6510 commit 86c3709

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pylint/interfaces.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919

2020
"""Interfaces for Pylint objects"""
2121
from collections import namedtuple
22-
from typing import TYPE_CHECKING, Tuple
22+
from typing import TYPE_CHECKING, Tuple, Type, Union
2323

2424
from astroid import nodes
2525

2626
if TYPE_CHECKING:
27+
from pylint.checkers import BaseChecker
2728
from pylint.reporters.ureports.nodes import Section
2829

2930
__all__ = (
@@ -59,7 +60,10 @@ def is_implemented_by(cls, instance):
5960
return implements(instance, cls)
6061

6162

62-
def implements(obj: "Interface", interface: Tuple[type, type]) -> bool:
63+
def implements(
64+
obj: "BaseChecker",
65+
interface: Union[Type["Interface"], Tuple[Type["Interface"], ...]],
66+
) -> bool:
6367
"""Return whether the given object (maybe an instance or class) implements
6468
the interface.
6569
"""

0 commit comments

Comments
 (0)