diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-14 09:42:35 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-14 10:00:25 +0200 |
commit | 2b2d1b564349c0736e9b110926376b1282159df4 (patch) | |
tree | 0b9e278540dc8ee313b0e483e075b95e99d4a75a /pylint/interfaces.py | |
parent | 01676aea6042da07bf52a35b5bf82cc55865d13a (diff) | |
download | pylint-git-2b2d1b564349c0736e9b110926376b1282159df4.tar.gz |
Use ``python-typing-update`` on ``pylint`` directory
Diffstat (limited to 'pylint/interfaces.py')
-rw-r--r-- | pylint/interfaces.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pylint/interfaces.py b/pylint/interfaces.py index 661525bac..fe1320b8a 100644 --- a/pylint/interfaces.py +++ b/pylint/interfaces.py @@ -3,8 +3,11 @@ # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt """Interfaces for Pylint objects.""" + +from __future__ import annotations + from collections import namedtuple -from typing import TYPE_CHECKING, Tuple, Type, Union +from typing import TYPE_CHECKING from astroid import nodes @@ -52,8 +55,8 @@ class Interface: def implements( - obj: "BaseChecker", - interface: Union[Type["Interface"], Tuple[Type["Interface"], ...]], + obj: BaseChecker, + interface: type[Interface] | tuple[type[Interface], ...], ) -> bool: """Does the given object (maybe an instance or class) implement the interface.""" implements_ = getattr(obj, "__implements__", ()) @@ -104,5 +107,5 @@ class IReporter(Interface): def handle_message(self, msg) -> None: """Handle the given message object.""" - def display_reports(self, layout: "Section") -> None: + def display_reports(self, layout: Section) -> None: """Display results encapsulated in the layout tree.""" |