GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — gh-81371: implementing checking async generator methods by wrongnull · Pull Request #102129 · python/cpython Conversation
| |||||||||||||||||||||||||
|
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
well, now I'm not sure if this changes matches your excpectations about the way how stdlib should look like
There was an error while loading. Please reload this page.
|
Is there one certain way to define if callable returns awaitable? I mean it is possible to reimplement some logic in C. For instance callable can has special flag to this purpose. It's because I'm not sure if my patch handles all possible corner cases so maybe there are more subtle ones. So if the checked object was not declared with async def the only way to check this condition is brute force it manually, I guess. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Couple of thoughts:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -0,0 +1 @@ | |||
| This PR may fix the issue 81371 | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
May? Or does it? Please, also specify what the issue is. These are user-facing notes. It must be clear without a github link.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
May? Or does it? Please, also specify what the issue is. These are user-facing notes. It must be clear without a github link.
I'm not 100% sure if it does. In the original issue those methods just returns some awaitable objects that doesn't pass the check. And I fixed it, but only for this certain example (I will add the tests soon). The obstacle is that I don't know if there are similar functions somewhere in the inerpreter. I'm not an internals expert. It would be great if you or someone else could suggest me such places.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Coroutine functions are normally defined with "async def" syntax, but may | ||
| be marked via markcoroutinefunction. | ||
| """ | ||
| #check if obj is async gen method and returns awaitable |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please, at least add tests for this feature.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
as soon as I fully understand the original question
Sorry, something went wrong.
There was an error while loading. Please reload this page.
See #81371 (comment) I don't think the current approach in this PR is the right approach; we shouldn't be checking against an approved list of method names. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
See above comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
But there is no way to add attribute to builtin function without monkey patching. Do we need new type(s) to this? Such as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What if |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This isn't the way to fix this, I am closing this, please continue the discussion on the issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
asyncio.iscoroutinefunction(<async_generator>.asend) returns False
There was an error while loading. Please reload this page.