Typing Error for Default Lambda Arg when using Generics
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Wanted to cross-post this issue from Pyright: https://github.com/microsoft/pyright/issues/7291
From giving this same example a try in the MyPy playground. (Version 3.12, MyPy 1.8.0). We see that that MyPy complains about the initial function assignment because I is being passed in for V, even though V is bound to Any.
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 by reproducing the generic default-lambda example from the linked Pyright issue in the MyPy playground using Python 3.12 and MyPy 1.8.0. Trace the type-checking behavior around the initial function assignment; done means the reported typing error is resolved without regressing the expected generic behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100