-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
Update await_maybe #1505
Update await_maybe #1505
Conversation
Thanks for adding the Here's a preview of the changelog: This release modifies the internal utility function Here's the preview release card for twitter: Here's the tweet text:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'm going to double check the difference between iscoroutine and isawaitable and then approve the PR[1] 😊
[1] there's also asyncio.iscoroutine so I'm a bit confused and what to make sure we use the right check :)
Codecov Report
@@ Coverage Diff @@
## main #1505 +/- ##
=======================================
Coverage 98.11% 98.11%
=======================================
Files 128 128
Lines 4396 4396
Branches 746 746
=======================================
Hits 4313 4313
Misses 43 43
Partials 40 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -8,7 +8,7 @@ | |||
|
|||
|
|||
async def await_maybe(value: AwaitableOrValue): | |||
if inspect.iscoroutine(value): | |||
if inspect.isawaitable(value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/python/cpython/blob/main/Lib/inspect.py#L446-L451 all good I'd say :)
Thanks for contributing to Strawberry! 🎉 You've been invited to join You can also request a free sticker by filling this form: https://forms.gle/dmnfQUPoY5gZbVT67 And don't forget to join our discord server: https://strawberry.rocks/discord 🔥 |
Replace
iscoroutine
withisawaitable
inawait_maybe
towards the update to mypy 0.920.Details
We are currently on version 0.910 of mypy, and are working towards updating to 0.920 in #1503.
In the new mypy version we get the following error in
await_maybe
:This PR modifies the function to use
isawaitable
instead ofiscorotuine
, which fixes the error.Types of Changes
Checklist