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/cli/common.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/cli/common.py')
-rw-r--r-- | src/mlia/cli/common.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mlia/cli/common.py b/src/mlia/cli/common.py index 54bd457..3f60668 100644 --- a/src/mlia/cli/common.py +++ b/src/mlia/cli/common.py @@ -1,10 +1,11 @@ # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. # SPDX-License-Identifier: Apache-2.0 """CLI common module.""" +from __future__ import annotations + import argparse from dataclasses import dataclass from typing import Callable -from typing import List @dataclass @@ -12,8 +13,8 @@ class CommandInfo: """Command description.""" func: Callable - aliases: List[str] - opt_groups: List[Callable[[argparse.ArgumentParser], None]] + aliases: list[str] + opt_groups: list[Callable[[argparse.ArgumentParser], None]] is_default: bool = False @property @@ -22,7 +23,7 @@ class CommandInfo: return self.func.__name__ @property - def command_name_and_aliases(self) -> List[str]: + def command_name_and_aliases(self) -> list[str]: """Return list of command name and aliases.""" return [self.command_name, *self.aliases] |