From a5e93e678f38847b2c29427e26c7ef81f648b1cb Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Mon, 28 Oct 2024 11:23:57 +0100 Subject: [PATCH] Minor types updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subset of #1272 – which should be incontroversial and does not conflict with recent changes. --- ipykernel/kernelapp.py | 7 ++++--- pyproject.toml | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index 55efaa8e..b610c077 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,9 @@ 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 e1d7b1d5..fcdd3110 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -275,6 +275,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