We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
contextvars.Token
1 parent 33a488e commit d6f4fb8Copy full SHA for d6f4fb8
Doc/library/contextvars.rst
@@ -93,13 +93,15 @@ Context Variables
93
# After the reset call the var has no value again, so
94
# var.get() would raise a LookupError.
95
96
+ The same *token* cannot be used twice.
97
+
98
99
.. class:: Token
100
101
*Token* objects are returned by the :meth:`ContextVar.set` method.
102
They can be passed to the :meth:`ContextVar.reset` method to revert
103
the value of the variable to what it was before the corresponding
- *set*.
104
+ *set*. A single token cannot reset a context variable more than once.
105
106
.. attribute:: Token.var
107
0 commit comments