diff --git a/libmat2/__init__.py b/libmat2/__init__.py
index 2f202654e845211c8728d6f00f9857660bc1338d..4974377004693188505a9037ee7aaee01c70866c 100644
--- a/libmat2/__init__.py
+++ b/libmat2/__init__.py
@@ -2,14 +2,10 @@
 
 import enum
 import importlib
-from typing import Optional, Union, Dict
+from typing import Dict
 
 from . import exiftool, video
 
-# make pyflakes happy
-assert Optional
-assert Union
-
 # A set of extension that aren't supported, despite matching a supported mimetype
 UNSUPPORTED_EXTENSIONS = {
     '.asc',
@@ -68,7 +64,7 @@ CMD_DEPENDENCIES = {
 
 
 def check_dependencies() -> Dict[str, Dict[str, bool]]:
-    ret = dict()  # type: Dict[str, Dict]
+    ret: Dict[str, Dict] = dict()
 
     for key, value in DEPENDENCIES.items():
         ret[key] = {
diff --git a/libmat2/abstract.py b/libmat2/abstract.py
index 1aff6308817ea35d0cc3c383f408d68bcd2e0281..c531fbdf51a1b9dad956cd34fd793cdfee6fb680 100644
--- a/libmat2/abstract.py
+++ b/libmat2/abstract.py
@@ -9,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[str] = set()
+    mimetypes: Set[str] = set()
 
     def __init__(self, filename: str) -> None:
         """
diff --git a/libmat2/archive.py b/libmat2/archive.py
index beadd50b124ea2dae7a4f62ce10f129a540f26a7..847f81c56e8055cd7cbf110c148c8893b010877c 100644
--- a/libmat2/archive.py
+++ b/libmat2/archive.py
@@ -49,15 +49,15 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
 
         # Those are the files that have a format that _isn't_
         # supported by mat2, but that we want to keep anyway.
-        self.files_to_keep = set()  # type: Set[Pattern]
+        self.files_to_keep: Set[Pattern] = set()
 
         # Those are the files that we _do not_ want to keep,
         # no matter if they are supported or not.
-        self.files_to_omit = set()  # type: Set[Pattern]
+        self.files_to_omit: Set[Pattern] = set()
 
         # what should the parser do if it encounters an unknown file in
         # the archive?
-        self.unknown_member_policy = UnknownMemberPolicy.ABORT  # type: UnknownMemberPolicy
+        self.unknown_member_policy: UnknownMemberPolicy = UnknownMemberPolicy.ABORT
 
         # The LGTM comment is to mask a false-positive,
         # see https://lgtm.com/projects/g/jvoisin/mat2/
@@ -134,7 +134,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
         return member
 
     def get_meta(self) -> Dict[str, Union[str, Dict]]:
-        meta = dict()  # type: Dict[str, Union[str, Dict]]
+        meta: Dict[str, Union[str, Dict]] = dict()
 
         with self.archive_class(self.filename) as zin:
             temp_folder = tempfile.mkdtemp()
@@ -174,7 +174,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
 
             # Sort the items to process, to reduce fingerprinting,
             # and keep them in the `items` variable.
-            items = list()  # type: List[ArchiveMember]
+            items: List[ArchiveMember] = list()
             for item in sorted(self._get_all_members(zin), key=self._get_member_name):
                 # Some fileformats do require to have the `mimetype` file
                 # as the first file in the archive.
diff --git a/libmat2/audio.py b/libmat2/audio.py
index aa4afdbe75631b55bc1e4d66ebb519fb06f80bb3..13ed2914da85914484aff1a38eb26d5381e17445 100644
--- a/libmat2/audio.py
+++ b/libmat2/audio.py
@@ -39,7 +39,7 @@ class MP3Parser(MutagenParser):
     mimetypes = {'audio/mpeg', }
 
     def get_meta(self) -> Dict[str, Union[str, Dict]]:
-        metadata = {}  # type: Dict[str, Union[str, Dict]]
+        metadata: Dict[str, Union[str, Dict]] = dict()
         meta = mutagen.File(self.filename).tags
         if not meta:
             return metadata
diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py
index 2b91ac2d19bd4d796bd7b7b588dd9465e5b06799..605ef0d9d4d2f53d174583e39d279ce1af060bae 100644
--- a/libmat2/exiftool.py
+++ b/libmat2/exiftool.py
@@ -15,7 +15,7 @@ class ExiftoolParser(abstract.AbstractParser):
     from a import file, hence why several parsers are re-using its `get_meta`
     method.
     """
-    meta_allowlist = set()  # type: Set[str]
+    meta_allowlist: Set[str] = set()
 
     def get_meta(self) -> Dict[str, Union[str, Dict]]:
         try:
diff --git a/libmat2/images.py b/libmat2/images.py
index e7cdf5ab2a0659e7c544aaf9974e147175758fcc..254438bceca79ef35a0c47eb54ffc66f2e22087c 100644
--- a/libmat2/images.py
+++ b/libmat2/images.py
@@ -11,9 +11,6 @@ from gi.repository import GdkPixbuf, GLib, Rsvg
 
 from . import exiftool, abstract
 
-# Make pyflakes happy
-assert Any
-
 class SVGParser(exiftool.ExiftoolParser):
     mimetypes = {'image/svg+xml', }
     meta_allowlist = {'Directory', 'ExifToolVersion', 'FileAccessDate',
@@ -162,7 +159,7 @@ class PPMParser(abstract.AbstractParser):
     mimetypes = {'image/x-portable-pixmap'}
 
     def get_meta(self) -> Dict[str, Union[str, Dict]]:
-        meta = {}  # type: Dict[str, Union[str, Dict[Any, Any]]]
+        meta: Dict[str, Union[str, Dict[Any, Any]]] = dict()
         with open(self.filename) as f:
             for idx, line in enumerate(f):
                 if line.lstrip().startswith('#'):
diff --git a/libmat2/office.py b/libmat2/office.py
index f0ab404712d83733f8ac383d3f6da46b2db52a17..16b20c98c1614a66d424c1e97954e142c2f282a9 100644
--- a/libmat2/office.py
+++ b/libmat2/office.py
@@ -148,7 +148,7 @@ class MSOfficeParser(ZipParser):
                 return False
             xml_data = zin.read('[Content_Types].xml')
 
-        self.content_types = dict()  # type: Dict[str, str]
+        self.content_types: Dict[str, str] = dict()
         try:
             tree = ET.fromstring(xml_data)
         except ET.ParseError:
diff --git a/libmat2/video.py b/libmat2/video.py
index 39059c5d7c2dfc755dd8fc630752676b8f34dd9a..3e003df5823246fee7f7c848920726a5a59b1833 100644
--- a/libmat2/video.py
+++ b/libmat2/video.py
@@ -12,7 +12,7 @@ from . import bubblewrap
 class AbstractFFmpegParser(exiftool.ExiftoolParser):
     """ Abstract parser for all FFmpeg-based ones, mainly for video. """
     # Some fileformats have mandatory metadata fields
-    meta_key_value_allowlist = {}  # type: Dict[str, Union[str, int]]
+    meta_key_value_allowlist: Dict[str, Union[str, int]] = dict()
 
     def remove_all(self) -> bool:
         if self.meta_key_value_allowlist:
@@ -48,7 +48,7 @@ class AbstractFFmpegParser(exiftool.ExiftoolParser):
     def get_meta(self) -> Dict[str, Union[str, Dict]]:
         meta = super().get_meta()
 
-        ret = dict()  # type: Dict[str, Union[str, Dict]]
+        ret: Dict[str, Union[str, Dict]] = dict()
         for key, value in meta.items():
             if key in self.meta_key_value_allowlist:
                 if value == self.meta_key_value_allowlist[key]:
diff --git a/libmat2/web.py b/libmat2/web.py
index f2938e2a0274b5f54dd6829c1291f15ce8b40bab..e33288e35a44008859679d61b8a38222d6cb5a3e 100644
--- a/libmat2/web.py
+++ b/libmat2/web.py
@@ -44,10 +44,10 @@ class CSSParser(abstract.AbstractParser):
 
 
 class AbstractHTMLParser(abstract.AbstractParser):
-    tags_blocklist = set()  # type: Set[str]
+    tags_blocklist: Set[str] = set()
     # In some html/xml-based formats some tags are mandatory,
     # so we're keeping them, but are discarding their content
-    tags_required_blocklist = set()  # type: Set[str]
+    tags_required_blocklist: Set[str] = set()
 
     def __init__(self, filename):
         super().__init__(filename)
@@ -91,7 +91,7 @@ class _HTMLParser(parser.HTMLParser):
         self.filename = filename
         self.__textrepr = ''
         self.__meta = {}
-        self.__validation_queue = []  # type: list[str]
+        self.__validation_queue: List[str] = list()
 
         # We're using counters instead of booleans, to handle nested tags
         self.__in_dangerous_but_required_tag = 0
diff --git a/mat2 b/mat2
index 43604d4a64df492a21050c48326e3f314ad35d1d..15b2fd2d571b49603950170fc8d081bdb4860e97 100755
--- a/mat2
+++ b/mat2
@@ -36,7 +36,7 @@ def __check_file(filename: str, mode: int = os.R_OK) -> bool:
         __print_without_chars("[-] %s is not a regular file." % filename)
         return False
     elif not os.access(filename, mode):
-        mode_str = []  # type: List[str]
+        mode_str: List[str] = list()
         if mode & os.R_OK:
             mode_str += 'readable'
         if mode & os.W_OK:
@@ -168,7 +168,7 @@ def show_parsers():
 
 
 def __get_files_recursively(files: List[str]) -> List[str]:
-    ret = set()  # type: Set[str]
+    ret: Set[str] = set()
     for f in files:
         if os.path.isdir(f):
             for path, _, _files in os.walk(f):