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-128307: support eager_start kwarg in create_eager_task_factory, and pass kwargs from asyncio.create_task and TaskGroup.create_task by graingert · Pull Request #128306 · python/cpython Conversation
|
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
yup, it's in I just forgot to add it to the news |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
0699ae2 to
7bce401
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
How would the loop even know what type task factory was installed so as to raise? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assuming the segfault will be fixed, let's just work through adding eager_start to all create_task methods. (We can test with the crux of that fix patched in.) @graingert Do you need help writing any code? One thing I'd like to ensure is that at least It might be possible to come up with a protocol whereby a task factory communicates which |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I strongly disagree with raising an exception in the currently supported loop.create_task(eager_start=True) case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
So what would you have happen if the task factory doesn't support eager starts? This API is a breaking change if lazy task factories now must handle this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah I see, yes then an exception in that case is the current behaviour |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
But by looking at more of the code I just learned that the eagerness is purely implemented by passing There's one bit of behavior that's changed -- not sure if we care (the docs do not mention it): if you explicitly use |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I know why the tests fail, will fix in a moment. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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.
@graingert Are you okay if I merge this once the tests pass?
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.
Just giving everything a final look over
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM! Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
W00t! Goodnight everyone. Welcome to beta 1. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It's already fixed, here's the issue: #133419 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
|
|
||
| def create_task(coro, *, name=None, context=None): | ||
| def create_task(coro, **kwargs): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
From the Python user perspective, I don't like this change.
It obscures the allowed kwargs and makes it harder for IDEs to provide suggestions.
I suppose we'd be relying on https://github.com/python/typeshed/blob/main/stdlib/asyncio/tasks.pyi from now on?
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.
I agree it would be nice if we could avoid the **kwargs, but it make the implementation more complex at every level of indirection (asyncio.create_task -> loop.create_task -> Task, and also TaskGroup.create_task -> loop.create_task -> Task).
IDEs should be using typeshed anyway. (And we should update tasks.pyi to have a case for 3.14 that adds eager_start and **kwargs. In fact this should be done to all the create_task definitions found in typeshed's asyncio definitions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ory and various create_task functions (python#128306) Some create_task() functions were changed from `name=None, context=None` to `**kwargs`. Co-authored-by: Guido van Rossum <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.