summaryrefslogtreecommitdiff
path: root/libmat2/abstract.py
diff options
context:
space:
mode:
authorjvoisin2022-08-28 22:29:06 +0200
committerjvoisin2022-08-28 22:29:06 +0200
commitcc5be8608b49d74a633b80a95a49a018d4dcd477 (patch)
tree322c21ba2543831d5a1804ebce50a3f7c2391029 /libmat2/abstract.py
parent292f44c0861a57b54a289641ead7e59f158e307e (diff)
Simplify the typing annotations
Diffstat (limited to 'libmat2/abstract.py')
-rw-r--r--libmat2/abstract.py10
1 files changed, 4 insertions, 6 deletions
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 @@
1import abc 1import abc
2import os 2import os
3import re 3import re
4from typing import Set, Dict, Union 4from typing import Union
5
6assert Set # make pyflakes happy
7 5
8 6
9class AbstractParser(abc.ABC): 7class AbstractParser(abc.ABC):
@@ -11,8 +9,8 @@ class AbstractParser(abc.ABC):
11 It might yield `ValueError` on instantiation on invalid files, 9 It might yield `ValueError` on instantiation on invalid files,
12 and `RuntimeError` when something went wrong in `remove_all`. 10 and `RuntimeError` when something went wrong in `remove_all`.
13 """ 11 """
14 meta_list = set() # type: Set[str] 12 meta_list = set() # type: set[str]
15 mimetypes = set() # type: Set[str] 13 mimetypes = set() # type: set[str]
16 14
17 def __init__(self, filename: str) -> None: 15 def __init__(self, filename: str) -> None:
18 """ 16 """
@@ -35,7 +33,7 @@ class AbstractParser(abc.ABC):
35 self.sandbox = True 33 self.sandbox = True
36 34
37 @abc.abstractmethod 35 @abc.abstractmethod
38 def get_meta(self) -> Dict[str, Union[str, dict]]: 36 def get_meta(self) -> dict[str, Union[str, dict]]:
39 """Return all the metadata of the current file""" 37 """Return all the metadata of the current file"""
40 38
41 @abc.abstractmethod 39 @abc.abstractmethod