False-positive `call-arg`: Too many arguments for "enum.auto"
Open
Nobody has claimed this yet.
bug
topic-enum
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
This code works (A is 5, B is 6), but mypy reports an error:
To Reproduce
from enum import IntEnum, auto
class MyEnum(IntEnum):
A = auto(5)
B = auto()
print(MyEnum.A)
print(MyEnum.B)
https://mypy-play.net/?mypy=latest&python=3.12&gist=09173111e5af20a50c0a8ab24223ef61
Expected Behavior
No error.
Actual Behavior
bug.py:5: error: Too many arguments for "auto" [call-arg]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: mypy 1.8.0 (compiled: yes)
- Mypy command-line flags: none
- Python version used: 3.12.2
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
Start with the reported bug.py reproduction and run mypy against the enum.auto(5) example, or open the linked mypy-play case. Trace how enum.auto arguments are checked and confirm that the completed change reports no error while preserving the shown enum values.
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
- 45/100