Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Further improvements to functools.partial handling#17425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
- Fixes another crash case / type inference in that case- Fix a false positive when calling the partially applied function- TypeTraverse / comment / daemon test follow up ilevkivskyi mentioned on the original PR
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ilevkivskyi left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Some nice improvements here, I added more ideas.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| seen_args.add(a) | ||
| actual_args.append(a) | ||
| actual_arg_kinds.append(ctx.arg_kinds[i][j]) | ||
| actual_arg_names.append(ctx.arg_names[i][j]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looking at this it seems to me a better strategy for the call site may be usingget_attribute_hook() for__call__? Unfortunately this hook is not called inis_subtype() etc yet. But at least it will be possible to precisely type-check something like this in future
deffoo(fn:Callable[[int,str],int])->None: ...fn=partial(some_other_fn,1,2)foo(fn)
Uh oh!
There was an error while loading.Please reload this page.
According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
- Fixes another crash case / type inference in that case- Fix a false positive when calling the partially applied function withkwargs- TypeTraverse / comment / daemon test follow up ilevkivskyi mentionedon the original PRSee also#17423
Uh oh!
There was an error while loading.Please reload this page.
See also#17423