From 5c0ae47cf5adc86a969097a09161e7ad569e04fe Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 25 Mar 2019 22:16:40 -0400 Subject: [PATCH] Fix type annotation --- tractor/_streaming.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 0ccf5fc..df7a783 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -1,4 +1,4 @@ -import contextvars +from contextvars import ContextVar from dataclasses import dataclass from typing import Any @@ -7,7 +7,7 @@ import trio from ._ipc import Channel -_context = contextvars.ContextVar('context') +_context: ContextVar['Context'] = ContextVar('context') @dataclass(frozen=True) @@ -30,8 +30,7 @@ class Context: def current_context(): - """Get the current streaming task's context instance. - + """Get the current task's context instance. """ return _context.get()