8
8
# -----------------------------------------------------------------------------
9
9
# Imports
10
10
# -----------------------------------------------------------------------------
11
+ from __future__ import annotations
12
+
11
13
import abc
14
+ from typing import TYPE_CHECKING , Any
15
+
16
+ if TYPE_CHECKING :
17
+ from .channelsabc import ChannelABC
12
18
13
19
# -----------------------------------------------------------------------------
14
20
# Main kernel client class
@@ -24,64 +30,71 @@ class KernelClientABC(metaclass=abc.ABCMeta):
24
30
"""
25
31
26
32
@abc .abstractproperty
27
- def kernel (self ):
33
+ def kernel (self ) -> Any :
28
34
pass
29
35
30
36
@abc .abstractproperty
31
- def shell_channel_class (self ):
37
+ def shell_channel_class (self ) -> type [ ChannelABC ] :
32
38
pass
33
39
34
40
@abc .abstractproperty
35
- def iopub_channel_class (self ):
41
+ def iopub_channel_class (self ) -> type [ ChannelABC ] :
36
42
pass
37
43
38
44
@abc .abstractproperty
39
- def hb_channel_class (self ):
45
+ def hb_channel_class (self ) -> type [ ChannelABC ] :
40
46
pass
41
47
42
48
@abc .abstractproperty
43
- def stdin_channel_class (self ):
49
+ def stdin_channel_class (self ) -> type [ ChannelABC ] :
44
50
pass
45
51
46
52
@abc .abstractproperty
47
- def control_channel_class (self ):
53
+ def control_channel_class (self ) -> type [ ChannelABC ] :
48
54
pass
49
55
50
56
# --------------------------------------------------------------------------
51
57
# Channel management methods
52
58
# --------------------------------------------------------------------------
53
59
54
60
@abc .abstractmethod
55
- def start_channels (self , shell = True , iopub = True , stdin = True , hb = True , control = True ):
61
+ def start_channels (
62
+ self ,
63
+ shell : bool = True ,
64
+ iopub : bool = True ,
65
+ stdin : bool = True ,
66
+ hb : bool = True ,
67
+ control : bool = True ,
68
+ ) -> None :
56
69
"""Start the channels for the client."""
57
70
pass
58
71
59
72
@abc .abstractmethod
60
- def stop_channels (self ):
73
+ def stop_channels (self ) -> None :
61
74
"""Stop the channels for the client."""
62
75
pass
63
76
64
77
@abc .abstractproperty
65
- def channels_running (self ):
78
+ def channels_running (self ) -> bool :
66
79
"""Get whether the channels are running."""
67
80
pass
68
81
69
82
@abc .abstractproperty
70
- def shell_channel (self ):
83
+ def shell_channel (self ) -> ChannelABC :
71
84
pass
72
85
73
86
@abc .abstractproperty
74
- def iopub_channel (self ):
87
+ def iopub_channel (self ) -> ChannelABC :
75
88
pass
76
89
77
90
@abc .abstractproperty
78
- def stdin_channel (self ):
91
+ def stdin_channel (self ) -> ChannelABC :
79
92
pass
80
93
81
94
@abc .abstractproperty
82
- def hb_channel (self ):
95
+ def hb_channel (self ) -> ChannelABC :
83
96
pass
84
97
85
98
@abc .abstractproperty
86
- def control_channel (self ):
99
+ def control_channel (self ) -> ChannelABC :
87
100
pass
0 commit comments