Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add missing overload for Task.__call__ #16891

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Add missing overload for Task.__call__ #16891

merged 1 commit into from
Jan 29, 2025

Conversation

desertaxle
Copy link
Member

This PR removes a duplicate overload for Task.__call__ and adds one to handle basic calls.

Here's the new overload, because the diff kinda obscures it:

    @overload
    def __call__(
        self: "Task[P, R]",
        *args: P.args,
        **kwargs: P.kwargs,
    ) -> R:
        ...

I added some type safety tests to prevent future regression.

Closes #16856

@github-actions github-actions bot added the bug Something isn't working label Jan 29, 2025
Copy link

codspeed-hq bot commented Jan 29, 2025

CodSpeed Performance Report

Merging #16891 will not alter performance

Comparing fix-16856 (c94e36f) with main (bd807de)

Summary

✅ 2 untouched benchmarks

Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@desertaxle desertaxle merged commit 9514808 into main Jan 29, 2025
49 checks passed
@desertaxle desertaxle deleted the fix-16856 branch January 29, 2025 18:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pylance reports type errors with basic example from docs
2 participants