Skip to content

Commit 9c64c1a

Browse files
NicolasHugdatumbox
authored andcommitted
[fbsync] Use --no-implicit-optional for type checking (#6413)
Summary: * Use --no-implicit-optional for type checking This is needed for PEP 484 compliant type checking (as of 2018). mypy will change its defaults soon. See python/mypy#9091 * forcing CI rerun Reviewed By: datumbox Differential Revision: D38824221 fbshipit-source-id: 2f786faadaedd7eaf0dd2147a9c575d1d86c9db0 Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
1 parent 67bdb83 commit 9c64c1a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ files = torchvision
44
show_error_codes = True
55
pretty = True
66
allow_redefinition = True
7+
no_implicit_optional = True
78
warn_redundant_casts = True
89

910
[mypy-torchvision.prototype.features.*]

torchvision/datasets/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def iterable_to_str(iterable: Iterable) -> str:
458458
def verify_str_arg(
459459
value: T,
460460
arg: Optional[str] = None,
461-
valid_values: Iterable[T] = None,
461+
valid_values: Optional[Iterable[T]] = None,
462462
custom_msg: Optional[str] = None,
463463
) -> T:
464464
if not isinstance(value, torch._six.string_classes):

0 commit comments

Comments
 (0)