FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add contextlib.AsyncContextDecorator by lancelote · Pull Request #5550 · python/typeshed · GitHub

Add contextlib.AsyncContextDecorator - #5550

Merged
JelleZijlstra merged 1 commit into
python:masterfrom
lancelote:async-ctx-dec
May 29, 2021
Merged

Add contextlib.AsyncContextDecorator#5550
JelleZijlstra merged 1 commit into
python:masterfrom
lancelote:async-ctx-dec

Conversation

Copy link
Copy Markdown
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: ...

Copy link
Copy Markdown
Contributor

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

JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

JelleZijlstra merged commit af376f4 into python:master May 29, 2021
lancelote deleted the async-ctx-dec branch May 29, 2021 14:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL