No error about repeated keyword argument
Open
Nobody has claimed this yet.
feature
topic-calls
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
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.gitseveral 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the Python snippet and mypy command shown in the report. Trace how mypy processes calls with repeated keyword arguments and locate the existing diagnostic tests for call expressions. Done means mypy reports an error for the duplicate keyword while preserving normal handling of **kwargs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100