Skip to content

Commit 2ecee41

Browse files
committed
clean up typing
1 parent af52866 commit 2ecee41

6 files changed

Lines changed: 17 additions & 17 deletions

File tree

ipykernel/inprocess/tests/test_kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from io import StringIO
77

88
import pytest
9-
from IPython.utils.io import capture_output # type:ignore[attr-defined]
9+
from IPython.utils.io import capture_output
1010
from jupyter_client.session import Session
1111

1212
from ipykernel.inprocess.blocking import BlockingInProcessKernelClient

ipykernel/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from .zmqshell import ZMQInteractiveShell
2828

2929
try:
30-
from IPython.core.interactiveshell import _asyncio_runner # type:ignore[attr-defined]
30+
from IPython.core.interactiveshell import _asyncio_runner
3131
except ImportError:
3232
_asyncio_runner = None
3333

ipykernel/kernelapp.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from logging import StreamHandler
1616

1717
import zmq
18-
from IPython.core.application import ( # type:ignore[attr-defined]
18+
from IPython.core.application import (
1919
BaseIPythonApplication,
2020
base_aliases,
2121
base_flags,
@@ -88,12 +88,12 @@
8888
)
8989

9090
# inherit flags&aliases for any IPython shell apps
91-
kernel_aliases.update(shell_aliases) # type:ignore[arg-type]
91+
kernel_aliases.update(shell_aliases)
9292
kernel_flags.update(shell_flags)
9393

9494
# inherit flags&aliases for Sessions
95-
kernel_aliases.update(session_aliases) # type:ignore[arg-type]
96-
kernel_flags.update(session_flags) # type:ignore[arg-type]
95+
kernel_aliases.update(session_aliases)
96+
kernel_flags.update(session_flags)
9797

9898
_ctrl_c_message = """\
9999
NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.
@@ -114,8 +114,8 @@ class IPKernelApp(BaseIPythonApplication, InteractiveShellApp, ConnectionFileMix
114114
"""The IPYKernel application class."""
115115

116116
name = "ipython-kernel"
117-
aliases = Dict(kernel_aliases) # type:ignore[assignment]
118-
flags = Dict(kernel_flags) # type:ignore[assignment]
117+
aliases = Dict(kernel_aliases)
118+
flags = Dict(kernel_flags)
119119
classes = [IPythonKernel, ZMQInteractiveShell, ProfileDir, Session]
120120
# the kernel class, as an importstring
121121
kernel_class = Type(
@@ -660,9 +660,9 @@ def init_pdb(self):
660660

661661
if hasattr(debugger, "InterruptiblePdb"):
662662
# Only available in newer IPython releases:
663-
debugger.Pdb = debugger.InterruptiblePdb # type:ignore
663+
debugger.Pdb = debugger.InterruptiblePdb
664664
pdb.Pdb = debugger.Pdb # type:ignore
665-
pdb.set_trace = debugger.set_trace # type:ignore[assignment]
665+
pdb.set_trace = debugger.set_trace
666666

667667
@catch_config_error
668668
def initialize(self, argv=None):

ipykernel/tests/test_kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def _print_and_exit(sig, frame):
517517

518518

519519
def _start_children():
520-
ip = IPython.get_ipython() # type:ignore[attr-defined]
520+
ip = IPython.get_ipython()
521521
ns = ip.user_ns
522522

523523
cmd = [sys.executable, "-c", f"from {__name__} import _child; _child()"]

ipykernel/tests/test_zmq_shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_zmq_interactive_shell(kernel):
238238

239239
with warnings.catch_warnings():
240240
warnings.simplefilter("ignore", DeprecationWarning)
241-
shell.data_pub_class = MagicMock() # type:ignore
241+
shell.data_pub_class = MagicMock()
242242
shell.data_pub
243243
shell.kernel = kernel
244244
shell.set_next_input("hi")

ipykernel/zmqshell.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
from IPython.core.error import UsageError
2626
from IPython.core.interactiveshell import InteractiveShell, InteractiveShellABC
2727
from IPython.core.magic import Magics, line_magic, magics_class
28-
from IPython.core.magics import CodeMagics, MacroToEdit # type:ignore[attr-defined]
28+
from IPython.core.magics import CodeMagics, MacroToEdit
2929
from IPython.core.usage import default_banner
30-
from IPython.display import Javascript, display # type:ignore[attr-defined]
30+
from IPython.display import Javascript, display
3131
from IPython.utils import openpy
32-
from IPython.utils.process import arg_split, system # type:ignore[attr-defined]
32+
from IPython.utils.process import arg_split, system
3333
from jupyter_client.session import Session, extract_header
3434
from jupyter_core.paths import jupyter_runtime_dir
3535
from traitlets import Any, CBool, CBytes, Dict, Instance, Type, default, observe
@@ -435,7 +435,7 @@ class ZMQInteractiveShell(InteractiveShell):
435435

436436
displayhook_class = Type(ZMQShellDisplayHook)
437437
display_pub_class = Type(ZMQDisplayPublisher)
438-
data_pub_class = Any() # type:ignore[assignment]
438+
data_pub_class = Any()
439439
kernel = Any()
440440
parent_header = Any()
441441

@@ -516,7 +516,7 @@ def data_pub(self):
516516
stacklevel=2,
517517
)
518518

519-
self._data_pub = self.data_pub_class(parent=self) # type:ignore[has-type]
519+
self._data_pub = self.data_pub_class(parent=self)
520520
self._data_pub.session = self.display_pub.session
521521
self._data_pub.pub_socket = self.display_pub.pub_socket
522522
return self._data_pub

0 commit comments

Comments
 (0)