Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninjahauntsaninja commentedJun 22, 2024
edited
Loading

  • Fixes another crash case / type inference in that case
  • Fix a false positive when calling the partially applied function with kwargs
  • TypeTraverse / comment / daemon test follow up ilevkivskyi mentioned on the original PR

See also#17423

- 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
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Member

@ilevkivskyiilevkivskyi left a 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.

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])
Copy link
Member

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)

hauntsaninja reacted with thumbs up emoji
@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninjahauntsaninja merged commitd1d3c78 intopython:masterJul 1, 2024
hauntsaninja added a commit that referenced this pull requestJul 1, 2024
- 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
@hauntsaninjahauntsaninja deleted the functool-partial-more branchJuly 2, 2024 00:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ilevkivskyiilevkivskyiilevkivskyi approved these changes

+1 more reviewer

@sterliakovsterliakovsterliakov left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@hauntsaninja@ilevkivskyi@sterliakov

[8]ページ先頭

©2009-2025 Movatter.jp