diff options
Diffstat (limited to 'pylint/interfaces.py')
-rw-r--r-- | pylint/interfaces.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/pylint/interfaces.py b/pylint/interfaces.py index e657e7115..5b813c7b7 100644 --- a/pylint/interfaces.py +++ b/pylint/interfaces.py @@ -46,16 +46,13 @@ class Interface: def implements(obj: "Interface", interface: Tuple[type, type]) -> bool: - """Return true if the give object (maybe an instance or class) implements + """Return whether the given object (maybe an instance or class) implements the interface. """ kimplements = getattr(obj, "__implements__", ()) if not isinstance(kimplements, (list, tuple)): kimplements = (kimplements,) - for implementedinterface in kimplements: - if issubclass(implementedinterface, interface): - return True - return False + return any(issubclass(i, interface) for i in kimplements) class IChecker(Interface): |