@@ -235,7 +235,7 @@ def remove_restart_callback(self, callback: t.Callable, event: str = "restart")
235
235
# create a Client connected to our Kernel
236
236
# --------------------------------------------------------------------------
237
237
238
- def client (self , ** kwargs : Any ) -> KernelClient :
238
+ def client (self , ** kwargs : t . Any ) -> KernelClient :
239
239
"""Create a client configured to connect to our kernel"""
240
240
kw = {}
241
241
kw .update (self .get_connection_info (session = True ))
@@ -296,7 +296,7 @@ def from_ns(match):
296
296
297
297
return [pat .sub (from_ns , arg ) for arg in cmd ]
298
298
299
- async def _async_launch_kernel (self , kernel_cmd : t .List [str ], ** kw : Any ) -> None :
299
+ async def _async_launch_kernel (self , kernel_cmd : t .List [str ], ** kw : t . Any ) -> None :
300
300
"""actually launch the kernel
301
301
302
302
override in a subclass to launch kernel subprocesses differently
@@ -324,7 +324,7 @@ def _close_control_socket(self) -> None:
324
324
self ._control_socket .close ()
325
325
self ._control_socket = None
326
326
327
- async def _async_pre_start_kernel (self , ** kw : Any ) -> t .Tuple [t .List [str ], t .Dict [str , t .Any ]]:
327
+ async def _async_pre_start_kernel (self , ** kw : t . Any ) -> t .Tuple [t .List [str ], t .Dict [str , t .Any ]]:
328
328
"""Prepares a kernel for startup in a separate process.
329
329
330
330
If random ports (port=0) are being used, this method must be called
@@ -352,7 +352,7 @@ async def _async_pre_start_kernel(self, **kw: Any) -> t.Tuple[t.List[str], t.Dic
352
352
353
353
pre_start_kernel = run_sync (_async_pre_start_kernel )
354
354
355
- async def _async_post_start_kernel (self , ** kw : Any ) -> None :
355
+ async def _async_post_start_kernel (self , ** kw : t . Any ) -> None :
356
356
"""Performs any post startup tasks relative to the kernel.
357
357
358
358
Parameters
@@ -368,7 +368,7 @@ async def _async_post_start_kernel(self, **kw: Any) -> None:
368
368
post_start_kernel = run_sync (_async_post_start_kernel )
369
369
370
370
@in_pending_state
371
- async def _async_start_kernel (self , ** kw : Any ) -> None :
371
+ async def _async_start_kernel (self , ** kw : t . Any ) -> None :
372
372
"""Starts a kernel on this host in a separate process.
373
373
374
374
If random ports (port=0) are being used, this method must be called
@@ -500,7 +500,7 @@ async def _async_shutdown_kernel(self, now: bool = False, restart: bool = False)
500
500
shutdown_kernel = run_sync (_async_shutdown_kernel )
501
501
502
502
async def _async_restart_kernel (
503
- self , now : bool = False , newports : bool = False , ** kw : Any
503
+ self , now : bool = False , newports : bool = False , ** kw : t . Any
504
504
) -> None :
505
505
"""Restarts a kernel with the arguments that were used to launch it.
506
506
@@ -661,7 +661,7 @@ class AsyncKernelManager(KernelManager):
661
661
662
662
663
663
def start_new_kernel (
664
- startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : Any
664
+ startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : t . Any
665
665
) -> t .Tuple [KernelManager , KernelClient ]:
666
666
"""Start a new kernel, and return its Manager and Client"""
667
667
km = KernelManager (kernel_name = kernel_name )
@@ -679,7 +679,7 @@ def start_new_kernel(
679
679
680
680
681
681
async def start_new_async_kernel (
682
- startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : Any
682
+ startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : t . Any
683
683
) -> t .Tuple [AsyncKernelManager , KernelClient ]:
684
684
"""Start a new kernel, and return its Manager and Client"""
685
685
km = AsyncKernelManager (kernel_name = kernel_name )
@@ -697,7 +697,7 @@ async def start_new_async_kernel(
697
697
698
698
699
699
@contextmanager
700
- def run_kernel (** kwargs : Any ) -> t .Iterator [KernelClient ]:
700
+ def run_kernel (** kwargs : t . Any ) -> t .Iterator [KernelClient ]:
701
701
"""Context manager to create a kernel in a subprocess.
702
702
703
703
The kernel is shut down when the context exits.
0 commit comments