Skip to content

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Nov 23, 2021

If ParamSpec is in the context of a lambda, treat it similar
to Callable[..., Any]. This allows us to infer at least argument
counts and kinds. Types can't be inferred since that would require
"backwards" type inference, which we don't support.

Follow-up to #11594.

If ParamSpec is in the context of a lambda, treat it similar
to `Callable[..., Any]`. This allows us to infer at least argument
counts and kinds. Types can't be inferred since that would require
"backwards" type inference, which we don't support.

Follow-up to #11594.
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

spark (https://github.com/apache/spark.git)
- python/pyspark/shell.py:49: error: Cannot infer type of lambda  [misc]

tornado (https://github.com/tornadoweb/tornado.git)
- tornado/util.py:55: error: Cannot infer type of lambda

@JukkaL JukkaL merged commit 83e9e3b into master Nov 23, 2021
@JukkaL JukkaL deleted the paramspec-lambda branch November 23, 2021 17:55
tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
If ParamSpec is in the context of a lambda, treat it similar
to `Callable[..., Any]`. This allows us to infer at least argument
counts and kinds. Types can't be inferred since that would require
"backwards" type inference, which we don't support.

Follow-up to python#11594.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants