From f5b293d0927506c2a979a091bf0d07ecc78fa181 Mon Sep 17 00:00:00 2001 From: Dmitrii Agibov Date: Thu, 8 Sep 2022 14:24:39 +0100 Subject: MLIA-386 Simplify typing in the source code - Enable deferred annotations evaluation - Use builtin types for type hints whenever possible - Use | syntax for union types - Rename mlia.core._typing into mlia.core.typing Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a --- src/mlia/devices/tosa/handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mlia/devices/tosa/handlers.py') diff --git a/src/mlia/devices/tosa/handlers.py b/src/mlia/devices/tosa/handlers.py index 00c18c5..5f015c4 100644 --- a/src/mlia/devices/tosa/handlers.py +++ b/src/mlia/devices/tosa/handlers.py @@ -2,12 +2,13 @@ # SPDX-License-Identifier: Apache-2.0 """TOSA Advisor event handlers.""" # pylint: disable=R0801 +from __future__ import annotations + import logging -from typing import Optional -from mlia.core._typing import PathOrFileLike from mlia.core.events import CollectedDataEvent from mlia.core.handlers import WorkflowEventsHandler +from mlia.core.typing import PathOrFileLike from mlia.devices.tosa.events import TOSAAdvisorEventHandler from mlia.devices.tosa.events import TOSAAdvisorStartedEvent from mlia.devices.tosa.operators import TOSACompatibilityInfo @@ -19,7 +20,7 @@ logger = logging.getLogger(__name__) class TOSAEventHandler(WorkflowEventsHandler, TOSAAdvisorEventHandler): """Event handler for TOSA advisor.""" - def __init__(self, output: Optional[PathOrFileLike] = None) -> None: + def __init__(self, output: PathOrFileLike | None = None) -> None: """Init event handler.""" super().__init__(tosa_formatters, output) -- cgit v1.2.1