diff --git a/swh/model/cli.py b/swh/model/cli.py
index 622066199f3144bed63044a3a37ef8d93eb38155..abcabfe17ae2215ace4e8604fed3d19f8cab5785 100644
--- a/swh/model/cli.py
+++ b/swh/model/cli.py
@@ -69,7 +69,9 @@ def swhid_of_file_content(data) -> CoreSWHID:
     return object.swhid()
 
 
-def model_of_dir(path: bytes, exclude_patterns: Iterable[bytes] = None) -> Directory:
+def model_of_dir(
+    path: bytes, exclude_patterns: Optional[Iterable[bytes]] = None
+) -> Directory:
     from swh.model.from_disk import accept_all_directories, ignore_directories_patterns
 
     dir_filter = (
@@ -81,7 +83,9 @@ def model_of_dir(path: bytes, exclude_patterns: Iterable[bytes] = None) -> Direc
     return Directory.from_disk(path=path, dir_filter=dir_filter)
 
 
-def swhid_of_dir(path: bytes, exclude_patterns: Iterable[bytes] = None) -> CoreSWHID:
+def swhid_of_dir(
+    path: bytes, exclude_patterns: Optional[Iterable[bytes]] = None
+) -> CoreSWHID:
     obj = model_of_dir(path, exclude_patterns)
     return obj.swhid()
 
diff --git a/swh/model/model.py b/swh/model/model.py
index 29c7d6e25d017300d207b654104380ff97e6a711..3572284d6fb328520ae82c5ca86352abd4a0e94b 100644
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -59,10 +59,6 @@ Sha1Git = bytes
 Sha1 = bytes
 
 
-KT = TypeVar("KT")
-VT = TypeVar("VT")
-
-
 def hash_repr(h: bytes) -> str:
     if h is None:
         return "None"
@@ -71,8 +67,8 @@ def hash_repr(h: bytes) -> str:
 
 
 def freeze_optional_dict(
-    d: Union[None, Dict[KT, VT], ImmutableDict[KT, VT]]  # type: ignore
-) -> Optional[ImmutableDict[KT, VT]]:
+    d: Union[None, Dict, ImmutableDict]
+) -> Optional[ImmutableDict]:
     if isinstance(d, dict):
         return ImmutableDict(d)
     else:
diff --git a/tox.ini b/tox.ini
index 38261f49afac52c64a361662b2bdb4f40bd91ba4..e116f83264c00611c9dd45b189972c8b62943ffd 100644
--- a/tox.ini
+++ b/tox.ini
@@ -41,7 +41,7 @@ commands =
 extras =
   testing
 deps =
-  mypy==0.942
+  mypy==1.0
 commands =
   mypy swh