-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed as not planned
Labels
Description
Bug report
Bug description:
The asyncio.BaseEventLoop.create_task
loop method does not pass the name
parameter to the task factory
There is two issues with this:
- Inconsistent with the eager task factory signature
- Users cannot easily configure the task name through just the task factory interface
A simple demonstration of this issue:
import asyncio
def new_task(loop, coro, name=None, context=None):
assert name is not None # Will raise
return asyncio.Task(coro, loop=loop, name=name, context=context)
async def main():
loop = asyncio.get_event_loop()
loop.set_task_factory(new_task)
loop.create_task(asyncio.sleep(1), name="task1")
if __name__ == "__main__":
asyncio.run(main())
Also see: #112623 (comment)
CPython versions tested on:
3.12
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Done