diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-08 14:24:39 +0100 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2022-09-09 17:21:48 +0100 |
commit | f5b293d0927506c2a979a091bf0d07ecc78fa181 (patch) | |
tree | 4de585b7cb6ed34da8237063752270189a730a41 /src/mlia/utils/console.py | |
parent | cde0c6ee140bd108849bff40467d8f18ffc332ef (diff) | |
download | mlia-f5b293d0927506c2a979a091bf0d07ecc78fa181.tar.gz |
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
Diffstat (limited to 'src/mlia/utils/console.py')
-rw-r--r-- | src/mlia/utils/console.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mlia/utils/console.py b/src/mlia/utils/console.py index 7cb3d83..1f428a7 100644 --- a/src/mlia/utils/console.py +++ b/src/mlia/utils/console.py @@ -1,9 +1,9 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """Console output utility functions.""" +from __future__ import annotations + from typing import Iterable -from typing import List -from typing import Optional from rich.console import Console from rich.console import RenderableType @@ -13,7 +13,7 @@ from rich.text import Text def create_section_header( - section_name: Optional[str] = None, length: int = 80, sep: str = "-" + section_name: str | None = None, length: int = 80, sep: str = "-" ) -> str: """Return section header.""" if not section_name: @@ -41,7 +41,7 @@ def style_improvement(result: bool) -> str: def produce_table( rows: Iterable, - headers: Optional[List[str]] = None, + headers: list[str] | None = None, table_style: str = "default", ) -> str: """Represent data in tabular form.""" |