Uh oh!
There was an error while loading. Please reload this page.
gh-67707: support partials in asyncio.iscoroutinefunction - #94907
Closed
graingert wants to merge 4 commits into
Closed
gh-67707: support partials in asyncio.iscoroutinefunction#94907graingert wants to merge 4 commits into
graingert wants to merge 4 commits into
Conversation
graingertforce-pushed
the
asyncio-iscoroutinefunction-partials
branch
from
July 16, 2022 23:51
4867490 to
1c0cf0aComparegraingert
commented
Jul 16, 2022
Uh oh!
There was an error while loading. Please reload this page.
graingert
commented
Jul 17, 2022
| getattr(func, '_is_coroutine', None) is _is_coroutine) | ||
| return ( | ||
| inspect.iscoroutinefunction(func) | ||
| or getattr(func, '_is_coroutine', None) is _is_coroutine |
ContributorAuthor
There was a problem hiding this comment.
this needs to both check the attribute and unwrap the partial so it can support code that worked around this issue by doing:
def sync_fn():
pass
partial_sync_fn = functools.partial(sync_fn)
partial_sync_fn._is_coroutine = asyncio.coroutines._is_coroutine
graingert
commented
Jul 17, 2022
ContributorAuthor
I'm closing this in favor of #94923 |
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 freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@asyncio.coroutinehas been removed in 3.11 so I'm not sure how useful this would be