Description
Description
Right now I'm starting to have problem with mypy/async and sync,
a couple of functions like km.start_kernel/ks._async_start_kernel
are sync/async
in upstream jupyter_client, but there are places where there is start_kernel = _async_start_kernel
, where upstream it's explicitly start_kernel = run_sync(_async_start_kernel)
. Now it's problematic as you can't swap one class for the other and mypy complain because:
- obviously if someone expect a sync method and call an async one, it's won't get run.
- if someone expect an async and we await a sync method you get error like "str is not an awaitable".
So right now in #1100, I can't fix mypy by correcting start_kernel = _async_start_kernel
to start_kernel = run_sync(_async_start_kernel)
, because then a bunch of test are failing,
and can't leave it as is, as it's incorrect WRT jupyter_client.
One possible change is to update jupyter_client to make start_kernel always async ?
I'm not sure which direction to go anymore.