false positive flags superclass method as undefined
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
mypy incorrectly complains that the __setstate__ method is undefined in the multiprocessing.Queue
Here is where __setstate__ is defined:
To Reproduce
Expected Behavior
I expected no typechecking errors.
Actual Behavior
If you run the included gist above you will see:
main.py:12: error: "__setstate__" undefined in superclass [misc]
Found 1 error in 1 file (checked 1 source file)
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
Run the linked mypy-play reproduction with Python 3.12 and the listed flags, then compare the diagnostic with the setstate definition linked in CPython's Lib/multiprocessing/queues.py. Trace the superclass-method lookup that produces the undefined error and add or update a regression test for the gist case. Done means the reproduction reports no type-checking errors without introducing regressions.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100