Skip to content

Commit

Permalink
[fbsync] Use --no-implicit-optional for type checking (#6413)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
2 people authored and facebook-github-bot committed Aug 24, 2022
1 parent 67bdb83 commit 9c64c1a
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 9c64c1a

Please sign in to comment.