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
def_validate(x:int) ->int:
ifnotisinstance(x, int):
raiseTypeError('Argument must be an integer.')
ifx<0:
raiseValueError('Argument must be a non-negative integer.')
does not return an error with the mypy 0.4.2 that appeared in the Debian Sid repository for a while (*). The inference is that the None return is being treated as an int, which is a bit surprising.
Obviously I had intended to have:
def_validate(x:int):
ifnotisinstance(x, int):
raiseTypeError('Argument must be an integer.')
ifx<0:
raiseValueError('Argument must be a non-negative integer.')
which also passes the mypy test.
(*) Does anyone know why the mypy package has been removed from the Debian Sid repository?
The text was updated successfully, but these errors were encountered:
It's a different issue. There's already an issue for it (issue#?); the
problem is detecting that we fall off the end of the function body without
returning a value. (It's a little trickier than you might think because of
e.g. `while True: ...`.)
The code:
does not return an error with the mypy 0.4.2 that appeared in the Debian Sid repository for a while (*). The inference is that the None return is being treated as an int, which is a bit surprising.
Obviously I had intended to have:
which also passes the mypy test.
(*) Does anyone know why the mypy package has been removed from the Debian Sid repository?
The text was updated successfully, but these errors were encountered: