Kwargs, positional-only parameters and ParamSpec in asyncio

Most asyncio scheduling functions don’t allow passing keyword arguments. To do that, use functools.partial()

I’d like to be able to type annotate these scheduling methods like run_in_executor, call_soon with ParamSpec, however because they do not take kwargs it’s not possible:

see: mypy Playground

adding support for kwargs via positional-only parameters allows ParamSpec to work:
mypy Playground however it would be a breaking change when passing executor and func as kwargs and no other args:

>>> await asyncio.get_running_loop().run_in_executor(executor=None, func=sync_fn)

an additional caveat is that this would also have to change how Context is passed to these callbacks, eg: mypy Playground

The higher-level asyncio.to_thread is now typed with ParamSpec: add ParamSpec to asyncio.to_thread by graingert · Pull Request #6668 · python/typeshed · GitHub

Changing signatures to use positional-only arguments is not an option, it is a breaking change as you mentioned.

Maybe ParamSpec should be extended to accept *args only without **kwargs?
It is a pretty normal use case IMHO, useful not only to asyncio itself.