Skip to content

Commit 79ef12d

Browse files
committed
Misc type annotations
Extracted from ipython#1272
1 parent 8c8d7d2 commit 79ef12d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ipykernel/kernelapp.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from .ipkernel import IPythonKernel
5555
from .parentpoller import ParentPollerUnix, ParentPollerWindows
5656
from .shellchannel import ShellChannelThread
57+
from .thread import BaseThread
5758
from .zmqshell import ZMQInteractiveShell
5859

5960
# -----------------------------------------------------------------------------
@@ -142,9 +143,10 @@ class IPKernelApp(BaseIPythonApplication, InteractiveShellApp, ConnectionFileMix
142143
debug_shell_socket = Any()
143144
stdin_socket = Any()
144145
iopub_socket = Any()
145-
iopub_thread = Any()
146-
control_thread = Any()
147-
shell_channel_thread = Any()
146+
147+
iopub_thread: BaseThread
148+
control_thread: BaseThread
149+
shell_channel_thread: BaseThread
148150

149151
_ports = Dict()
150152

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ ignore = [
276276
"G002",
277277
# `open()` should be replaced by `Path.open()`
278278
"PTH123",
279+
# use `X | Y` for type annotations, this does not works for dynamic getting type hints on older python
280+
"UP007",
279281
]
280282
unfixable = [
281283
# Don't touch print statements

0 commit comments

Comments
 (0)