filter() type not properly derived from overriden __iter__()
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This seems to be a problem shared between mypy and Pylance.
See description in Pylance bug report: https://github.com/microsoft/pylance-release/issues/1295#issue-892717386
mypy version used is 0.812
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 issue description and the linked Pylance bug report, then reproduce the reported filter() typing behavior using mypy 0.812. Trace how an overridden iter() contributes to the inferred filter type. Done means the intended type is derived correctly and the behavior is covered by an appropriate regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100