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/core/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/core/common.py')
-rw-r--r-- | src/mlia/core/common.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mlia/core/common.py b/src/mlia/core/common.py index a11bf9a..63fb324 100644 --- a/src/mlia/core/common.py +++ b/src/mlia/core/common.py @@ -5,6 +5,8 @@ This module contains common interfaces/classess shared across core module. """ +from __future__ import annotations + from abc import ABC from abc import abstractmethod from enum import auto @@ -30,7 +32,7 @@ class AdviceCategory(Flag): ALL = OPERATORS | PERFORMANCE | OPTIMIZATION @classmethod - def from_string(cls, value: str) -> "AdviceCategory": + def from_string(cls, value: str) -> AdviceCategory: """Resolve enum value from string value.""" category_names = [item.name for item in AdviceCategory] if not value or value.upper() not in category_names: |