Skip to content

support eager_start and **kwargs in create_task, matching CPython 3.13 to 3.14#747

Closed
graingert wants to merge 1 commit intoMagicStack:masterfrom
graingert:create-task-kwargs
Closed

support eager_start and **kwargs in create_task, matching CPython 3.13 to 3.14#747
graingert wants to merge 1 commit intoMagicStack:masterfrom
graingert:create-task-kwargs

Conversation

@graingert
Copy link
Copy Markdown
Contributor

…1–3.14

loop.pyx.in is a new Tempita template that emits the correct create_task signature for each Python version at build time:

  • 3.14+: def create_task(self, coro, **kwargs) forwarding all kwargs to the factory/Task, matching CPython gh-128552
  • 3.13: def create_task(self, coro, *, name=None, context=None, **kwargs) passing extra kwargs through to the factory and Task
  • 3.11/3.12: def create_task(self, coro, *, name=None, context=None) matching CPython's behaviour for those versions
  • <3.11: legacy context.run path

setup.py uses Cython.Tempita to render loop.pyx.in → loop.pyx before calling cythonize, using the process_tempita pattern.

Fixes: #746

…1–3.14

loop.pyx.in is a new Tempita template that emits the correct
create_task signature for each Python version at build time:
- 3.14+: `def create_task(self, coro, **kwargs)` forwarding all
  kwargs to the factory/Task, matching CPython gh-128552
- 3.13:  `def create_task(self, coro, *, name=None, context=None, **kwargs)`
  passing extra kwargs through to the factory and Task
- 3.11/3.12: `def create_task(self, coro, *, name=None, context=None)`
  matching CPython's behaviour for those versions
- <3.11:  legacy context.run path

setup.py uses Cython.Tempita to render loop.pyx.in → loop.pyx before
calling cythonize, using the process_tempita pattern.

Fixes: MagicStack#746
@graingert graingert changed the title support eager_start and **kwargs in create_task, matching CPython 3.1… support eager_start and **kwargs in create_task, matching CPython 3.13 to 3.14 Apr 24, 2026
@graingert
Copy link
Copy Markdown
Contributor Author

ah upstream CI is failing will close for now

@graingert graingert closed this Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support **kwargs on loop.create_task like in 3.13 and 3.14

1 participant