diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index 55efaa8e..8deedaa8 100644 --- a/ipykernel/kernelapp.py +++ b/ipykernel/kernelapp.py @@ -54,6 +54,7 @@ from .ipkernel import IPythonKernel from .parentpoller import ParentPollerUnix, ParentPollerWindows from .shellchannel import ShellChannelThread +from .thread import BaseThread from .zmqshell import ZMQInteractiveShell # ----------------------------------------------------------------------------- @@ -142,9 +143,10 @@ class IPKernelApp(BaseIPythonApplication, InteractiveShellApp, ConnectionFileMix debug_shell_socket = Any() stdin_socket = Any() iopub_socket = Any() - iopub_thread = Any() - control_thread = Any() - shell_channel_thread = Any() + + iopub_thread: BaseThread + control_thread: BaseThread + shell_channel_thread: BaseThread _ports = Dict() diff --git a/pyproject.toml b/pyproject.toml index 675d9d87..2360b668 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -276,6 +276,8 @@ ignore = [ "G002", # `open()` should be replaced by `Path.open()` "PTH123", + # use `X | Y` for type annotations, this does not works for dynamic getting type hints on older python + "UP007", ] unfixable = [ # Don't touch print statements