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
mypy reports a missing return statement despite all cases of a Python 3.10 match statement return something.
To Reproduce
Try this piece of code:
deftoken_is_start_of_value(self) ->bool:
"""Check whether the current token is the start of a value. Returns: bool: True if the current token is the start of a value. """matchself.token_type:
caseTokenType.DELIMITERifself.tokenin ("[", "{"):
returnTruecaseTokenType.STRING|TokenType.NUMBER|TokenType.SYMBOL:
returnTruecase _:
returnFalse
Expected Behavior
mypy should not report a missing return statement.
Actual Behavior
mypy reports a missing return statement, see here:
Your Environment
Mypy version used: current master (0.940+dev.99f4d5af147d364eda1d4b99e79770c171896f13 99f4d5a)
Mypy command-line flags:
Mypy configuration options from mypy.ini (and other config files):
Python version used: Python 3.10.1
Operating system and version: macOS Monterey 12.0.1 (21A559)
The text was updated successfully, but these errors were encountered:
Bug Report
mypy reports a missing return statement despite all cases of a Python 3.10 match statement return something.
To Reproduce
Try this piece of code:
Expected Behavior
mypy should not report a missing return statement.
Actual Behavior
mypy reports a missing return statement, see here:
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: