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
I hope I got the title approximately right. In the example below, mypy does not seem to properly bind the return type of the decorated function (int) to T (or the other way around).
If you use the PR you mentioned and --new-type-inference all three examples seem to work correctly.
That is great, thank you! I had tried #15837 as well as --new-type-inference, but not at the same time ;) Looking forward to the next release with that PR.
Now that #15837 was merged I am going to close this (even though --new-type-inference is not on by default yet, there is no specific action item in this issue).
Uh oh!
There was an error while loading. Please reload this page.
Bug Report
I hope I got the title approximately right. In the example below,
mypy
does not seem to properly bind the return type of the decorated function (int
) toT
(or the other way around).To Reproduce
Example 1: decorator factory
Example 2:
decorator.decorator
-style decorator without argumentsExample 3:
decorator.decorator
-style decorator with arguments (crashes with 1.4.1, see #15824; does not crash with #15837)Expected Behavior
Actual Behavior
Your Environment
The text was updated successfully, but these errors were encountered:
I also posted this at https://stackoverflow.com/q/76844550/880783.
If you use the PR you mentioned and
--new-type-inference
all three examples seem to work correctly.That is great, thank you! I had tried #15837 as well as
--new-type-inference
, but not at the same time ;) Looking forward to the next release with that PR.Now that #15837 was merged I am going to close this (even though
--new-type-inference
is not on by default yet, there is no specific action item in this issue).