You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseRuntimeError("Cannot be used outside of a run context") fromNone
41
50
exceptKeyError:
42
51
# contextvars consistency
43
-
ifdefaultisnotself._NO_DEFAULT:
44
-
returndefault
52
+
# `type: ignore` awaiting https://github.com/python/mypy/issues/15553 to be fixed & released
53
+
ifdefaultisnot_NoValue:
54
+
returndefault# type: ignore[return-value]
45
55
46
-
ifself._defaultisnotself._NO_DEFAULT:
47
-
returnself._default
56
+
ifself._defaultisnot_NoValue:
57
+
returnself._default# type: ignore[return-value]
48
58
49
59
raiseLookupError(self) fromNone
50
60
51
-
defset(self, value):
61
+
defset(self, value: T) ->RunVarToken[T]:
52
62
"""Sets the value of this :class:`RunVar` for this current run
53
63
call.
54
64
55
65
"""
56
66
try:
57
67
old_value=self.get()
58
68
exceptLookupError:
59
-
token=_RunVarToken.empty(self)
69
+
token=RunVarToken._empty(self)
60
70
else:
61
-
token=_RunVarToken(self, old_value)
71
+
token=RunVarToken[T]._create(self, old_value)
62
72
63
73
# This can't fail, because if we weren't in Trio context then the
0 commit comments