Closed kevin-bates closed 2 years ago
One item I would like to discuss is the return value on async def methods.
Regarding my question regarding how to type-hint the return type of async def
methods, it looks like -> Awaitable[
return-type
]:
should really just be ->
return-type
:
per https://mypy.readthedocs.io/en/stable/more_types.html#typing-async-await, so I'm going to make another commit that updates this occurrence to str
and addresses the CodeQL issue that also exists.
This PR adds type hints to the methods within the
services/kernels
modules.One item I would like to discuss is the return value on
async def
methods. I added a return value ofAwaitable[str]
on thestart_kernel
method, but the other async methods (here and elsewhere in EG to the best of my knowledge) do not use theAwaitable
type and I'm curious what others think.The other thing I noticed is that my IDE (PyCharm) is hi-lighting
kernel_id
as an expected type ofuuid.pyi
where I've addedstr
yet none of the dependent repositories (jupyter_server
andjupyter_client
) specifyuuid.pyi
as a type hint (few even specifystr
). I suspect this particular annotation is coming from the installed package area via thepy.typed
file (although it is zero-length), but I'm not sure. Does anyone know what might be happening there? I suspect its some kind ofmypy
thing thatjupyter_server
andjupyter_client
are built with.Fixes: #848