Skip to content

Commit 87d6eaf

Browse files
authored
Enable no-implicit-optional and fix the one error that occurs (#2509)
This comes from the benc-mypy branch. See mypy issue python/mypy#9091 for a bit more discussion about this option.
1 parent 0cae4f7 commit 87d6eaf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ plugins = sqlmypy
77
# codebase.
88
disable_error_code = str-bytes-safe
99

10+
no_implicit_optional = True
11+
12+
1013
[mypy-non_existent.*]
1114
ignore_missing_imports = True
1215

parsl/executors/threads.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import typeguard
33
import concurrent.futures as cf
44

5-
from typing import Any, List, Optional
5+
from typing import List, Optional
66

7+
from parsl.data_provider.staging import Staging
78
from parsl.executors.status_handling import NoStatusHandlingExecutor
89
from parsl.utils import RepresentationMixin
910
from parsl.executors.errors import UnsupportedFeatureError
@@ -30,7 +31,7 @@ class ThreadPoolExecutor(NoStatusHandlingExecutor, RepresentationMixin):
3031

3132
@typeguard.typechecked
3233
def __init__(self, label: str = 'threads', max_threads: int = 2,
33-
thread_name_prefix: str = '', storage_access: List[Any] = None,
34+
thread_name_prefix: str = '', storage_access: Optional[List[Staging]] = None,
3435
working_dir: Optional[str] = None, managed: bool = True):
3536
NoStatusHandlingExecutor.__init__(self)
3637
self.label = label

0 commit comments

Comments
 (0)