Skip to content

Commit

Permalink
Use --no-implicit-optional for type checking (#6413)
Browse files Browse the repository at this point in the history
* 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

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
  • Loading branch information
hauntsaninja and datumbox authored Aug 15, 2022
1 parent fa8e34e commit 4db84b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ files = torchvision
show_error_codes = True
pretty = True
allow_redefinition = True
no_implicit_optional = True
warn_redundant_casts = True

[mypy-torchvision.prototype.features.*]
Expand Down
2 changes: 1 addition & 1 deletion torchvision/datasets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def iterable_to_str(iterable: Iterable) -> str:
def verify_str_arg(
value: T,
arg: Optional[str] = None,
valid_values: Iterable[T] = None,
valid_values: Optional[Iterable[T]] = None,
custom_msg: Optional[str] = None,
) -> T:
if not isinstance(value, torch._six.string_classes):
Expand Down

0 comments on commit 4db84b0

Please sign in to comment.