Open
Description
Consider this code:
def f(**kwargs: object) -> None: ...
f(a=1, a=2) # no errors here
Expected Behavior
Error from mypy like this: SyntaxError: keyword argument repeated: a
Actual Behavior
At runtime:
File "<some_file>", line 27
f(a=1, a=2)
^^^
SyntaxError: keyword argument repeated: a
Mypy's output:
>mypy file.py
Success: no issues found in 1 source file
Your Environment
- Mypy version used:
mypy 1.0.0+dev.154fee110f274fe6214eff856b65d437ee299fdb (compiled: no)
(I didpip install -U git+https://github.com/python/mypy.git
several minutes ago) - Mypy command-line flags: none
- Mypy configuration options from
mypy.ini
(and other config files): none - Python version used:
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Metadata
Metadata
Assignees
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
A5rocks commentedon Feb 7, 2023
Weirdly enough, looks like mypy used to warn about this, but this error was removed between v0.812 and v0.902 (based on runs in mypy-play).
I'll go ahead and bisect! [will edit this]
hauntsaninja commentedon Feb 7, 2023
@A5rocks if your bisection proves mysterious, I think there might be some Python version difference in whatever mypy-play.net is using
A5rocks commentedon Feb 7, 2023
It does appear mysterious, I tried 53ec9f3 (very much before v0.812) and it passed without errors. I'm not sure the proper way to do this.
hauntsaninja commentedon Feb 7, 2023
If I had to guess, it would be something like mypy-play.net is running 0.812 with Python 3.8 and 0.902 with Python 3.9. Or something like that
JelleZijlstra commentedon Feb 7, 2023
Possibly relevant:
A5rocks commentedon Feb 7, 2023
That error does look like what mypy spit out! That would explain it, even if I can't on a cursory glance figure out where mypy-play would be overriding its default version of 3.10 (ymyzk/mypy-playground@c6d07eb)