You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#12278Fixes#13191 (more tricky nested
use cases with optional/keyword args still don't work, but they are
quite tricky to fix and may selectively fixed later)
This unfortunately requires some special-casing, here is its summary:
* If actual argument for `Callable[P, T]` is non-generic and non-lambda,
do not put it into inference second pass.
* If we are able to infer constraints for `P` without using arguments
mapped to `*args: P.args` etc., do not add the constraint for `P` vs
those arguments (this applies to both top-level callable constraints,
and for nested callable constraints against callables that are known to
have imprecise argument kinds).
(Btw TODO I added is not related to this PR, I just noticed something
obviously wrong)
Bug Report
Passing
ParamSpec
'd function (e.g. namedspawn
) to itself results in an error:^ indentation added to highlight that the 'actual' and 'expected' types are the same (at least in their rendered form)
My motivation was to type-annotate
Greenlet.spawn
of thegevent
library.To Reproduce
Gist URL: https://gist.github.com/05a7c5bb1a380684d82210e5589fb048
Playground URL: https://mypy-play.net/?mypy=latest&python=3.10&gist=05a7c5bb1a380684d82210e5589fb048
Your Environment
The text was updated successfully, but these errors were encountered: