@@ -235,7 +235,7 @@ def remove_restart_callback(self, callback: t.Callable, event: str = "restart")
235235 # create a Client connected to our Kernel
236236 # --------------------------------------------------------------------------
237237
238- def client (self , ** kwargs : Any ) -> KernelClient :
238+ def client (self , ** kwargs : t . Any ) -> KernelClient :
239239 """Create a client configured to connect to our kernel"""
240240 kw = {}
241241 kw .update (self .get_connection_info (session = True ))
@@ -296,7 +296,7 @@ def from_ns(match):
296296
297297 return [pat .sub (from_ns , arg ) for arg in cmd ]
298298
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 :
300300 """actually launch the kernel
301301
302302 override in a subclass to launch kernel subprocesses differently
@@ -324,7 +324,9 @@ def _close_control_socket(self) -> None:
324324 self ._control_socket .close ()
325325 self ._control_socket = None
326326
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 (
328+ self , ** kw : t .Any
329+ ) -> t .Tuple [t .List [str ], t .Dict [str , t .Any ]]:
328330 """Prepares a kernel for startup in a separate process.
329331
330332 If random ports (port=0) are being used, this method must be called
@@ -352,7 +354,7 @@ async def _async_pre_start_kernel(self, **kw: Any) -> t.Tuple[t.List[str], t.Dic
352354
353355 pre_start_kernel = run_sync (_async_pre_start_kernel )
354356
355- async def _async_post_start_kernel (self , ** kw : Any ) -> None :
357+ async def _async_post_start_kernel (self , ** kw : t . Any ) -> None :
356358 """Performs any post startup tasks relative to the kernel.
357359
358360 Parameters
@@ -368,7 +370,7 @@ async def _async_post_start_kernel(self, **kw: Any) -> None:
368370 post_start_kernel = run_sync (_async_post_start_kernel )
369371
370372 @in_pending_state
371- async def _async_start_kernel (self , ** kw : Any ) -> None :
373+ async def _async_start_kernel (self , ** kw : t . Any ) -> None :
372374 """Starts a kernel on this host in a separate process.
373375
374376 If random ports (port=0) are being used, this method must be called
@@ -500,7 +502,7 @@ async def _async_shutdown_kernel(self, now: bool = False, restart: bool = False)
500502 shutdown_kernel = run_sync (_async_shutdown_kernel )
501503
502504 async def _async_restart_kernel (
503- self , now : bool = False , newports : bool = False , ** kw : Any
505+ self , now : bool = False , newports : bool = False , ** kw : t . Any
504506 ) -> None :
505507 """Restarts a kernel with the arguments that were used to launch it.
506508
@@ -661,7 +663,7 @@ class AsyncKernelManager(KernelManager):
661663
662664
663665def start_new_kernel (
664- startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : Any
666+ startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : t . Any
665667) -> t .Tuple [KernelManager , KernelClient ]:
666668 """Start a new kernel, and return its Manager and Client"""
667669 km = KernelManager (kernel_name = kernel_name )
@@ -679,7 +681,7 @@ def start_new_kernel(
679681
680682
681683async def start_new_async_kernel (
682- startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : Any
684+ startup_timeout : float = 60 , kernel_name : str = "python" , ** kwargs : t . Any
683685) -> t .Tuple [AsyncKernelManager , KernelClient ]:
684686 """Start a new kernel, and return its Manager and Client"""
685687 km = AsyncKernelManager (kernel_name = kernel_name )
@@ -697,7 +699,7 @@ async def start_new_async_kernel(
697699
698700
699701@contextmanager
700- def run_kernel (** kwargs : Any ) -> t .Iterator [KernelClient ]:
702+ def run_kernel (** kwargs : t . Any ) -> t .Iterator [KernelClient ]:
701703 """Context manager to create a kernel in a subprocess.
702704
703705 The kernel is shut down when the context exits.
0 commit comments