Skip to content

Commit a260b62

Browse files
committed
typing on contextvar
1 parent 5331ba6 commit a260b62

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ipykernel/kernelbase.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
" ipykernel 6.0 (2021). {target} does not seem to return an awaitable"
7373
)
7474

75+
T = t.TypeVar("T")
76+
7577

7678
def _accepts_parameters(meth, param_names):
7779
parameters = inspect.signature(meth).parameters
@@ -801,7 +803,7 @@ def get_parent(self, channel=None):
801803

802804
return self._get_shell_context_var(self._shell_parent)
803805

804-
def _get_shell_context_var(self, var: ContextVar):
806+
def _get_shell_context_var(self, var: ContextVar[T]) -> T:
805807
"""Lookup a ContextVar, falling back on the shell context
806808
807809
Allows for user-launched Threads to still resolve to the shell's mai context

0 commit comments

Comments
 (0)