From cc5be8608b49d74a633b80a95a49a018d4dcd477 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 28 Aug 2022 22:29:06 +0200 Subject: Simplify the typing annotations --- libmat2/abstract.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libmat2/abstract.py') diff --git a/libmat2/abstract.py b/libmat2/abstract.py index 5cfd0f2..426ccfc 100644 --- a/libmat2/abstract.py +++ b/libmat2/abstract.py @@ -1,9 +1,7 @@ import abc import os import re -from typing import Set, Dict, Union - -assert Set # make pyflakes happy +from typing import Union class AbstractParser(abc.ABC): @@ -11,8 +9,8 @@ class AbstractParser(abc.ABC): It might yield `ValueError` on instantiation on invalid files, and `RuntimeError` when something went wrong in `remove_all`. """ - meta_list = set() # type: Set[str] - mimetypes = set() # type: Set[str] + meta_list = set() # type: set[str] + mimetypes = set() # type: set[str] def __init__(self, filename: str) -> None: """ @@ -35,7 +33,7 @@ class AbstractParser(abc.ABC): self.sandbox = True @abc.abstractmethod - def get_meta(self) -> Dict[str, Union[str, dict]]: + def get_meta(self) -> dict[str, Union[str, dict]]: """Return all the metadata of the current file""" @abc.abstractmethod -- cgit v1.3