Unverified Commit 4db84b04 authored by Shantanu's avatar Shantanu Committed by GitHub
Browse files

Use --no-implicit-optional for type checking (#6413)

* 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 https://github.com/python/mypy/issues/9091



* forcing CI rerun
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent fa8e34ed
...@@ -4,6 +4,7 @@ files = torchvision ...@@ -4,6 +4,7 @@ files = torchvision
show_error_codes = True show_error_codes = True
pretty = True pretty = True
allow_redefinition = True allow_redefinition = True
no_implicit_optional = True
warn_redundant_casts = True warn_redundant_casts = True
[mypy-torchvision.prototype.features.*] [mypy-torchvision.prototype.features.*]
......
...@@ -458,7 +458,7 @@ T = TypeVar("T", str, bytes) ...@@ -458,7 +458,7 @@ T = TypeVar("T", str, bytes)
def verify_str_arg( def verify_str_arg(
value: T, value: T,
arg: Optional[str] = None, arg: Optional[str] = None,
valid_values: Iterable[T] = None, valid_values: Optional[Iterable[T]] = None,
custom_msg: Optional[str] = None, custom_msg: Optional[str] = None,
) -> T: ) -> T:
if not isinstance(value, torch._six.string_classes): if not isinstance(value, torch._six.string_classes):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment