-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
Typecheck a *.pyi file containing a function with positional only arguments raises a SyntaxError.
I use pypy3.9 (with pypy3.8 i don't get any errors)
To Reproduce
Run the code below with mypy and pypy3.9
def f(a:int, b:int, /) -> None:
...
Expected Behavior
No error
Actual Behavior
SyntaxError: Positional only arguments are only supported in Python (3, 8) and above.
I guess the reason is that when parsing a stubfile the feature_version 7 is used.
Running the code with feature_version 8 solves the problem
Your Environment
- Mypy version used: mypy 0.971 (compiled: no)
- Python version used:
Python 3.9.12 | packaged by conda-forge | (05fbe3aa, Aug 15 2022, 10:20:11)
[PyPy 7.3.9 with GCC 10.4.0]
- Operating system and version: Ubuntu
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong