You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe mypy should complain about Iterable[...] as an if condition, for example, since it generally doesn't define __nonzero__, so the check is likely unsafe? More generally, we could do this for all classes that don't define __nonzero__, but this could generate too many errors. One option would be to make this an optional check enabled by --strict, at least initially.
Examples:
deff(x: Iterable[int]) ->None:
ifnotx: # Might never be taken, or at least this could be inconsistently takenprint('x')
classA:
pass# No __nonzero__defg(a: A) ->None:
ifnota: # Similar to above? What if there are subclasses of 'A'?print('x')
The text was updated successfully, but these errors were encountered:
If cheap to implement, would it make sense to test this internally in Dropbox's code-base and get a sense of what is the ratio of errors to false positives?
Maybe mypy should complain about
Iterable[...]
as an if condition, for example, since it generally doesn't define__nonzero__
, so the check is likely unsafe? More generally, we could do this for all classes that don't define__nonzero__
, but this could generate too many errors. One option would be to make this an optional check enabled by--strict
, at least initially.Examples:
The text was updated successfully, but these errors were encountered: