Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contextlib.AsyncContextDecorator #5550

Merged
merged 1 commit into from
May 29, 2021

Conversation

lancelote
Copy link
Contributor

Yet another Python 3.10 addition - AsyncContextDecorator.

Links

Async Function Annotation

I wasn't sure how to properly type annotate the func parameter. In the end, I followed

ContextDecorator

Existing ContextDecorator annotation for comparison

_F = TypeVar("_F", bound=Callable[..., Any])
class ContextDecorator:
    def __call__(self, func: _F) -> _F: ...

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks!

@JelleZijlstra JelleZijlstra merged commit af376f4 into python:master May 29, 2021
@lancelote lancelote deleted the async-ctx-dec branch May 29, 2021 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants