Created
February 17, 2018 15:12
-
-
Save pfreixes/cb6447ee8cfd64becac0f101694c84eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 3.7.0b1 (v3.7.0b1:9561d7f501, Jan 30 2018, 19:10:11) | |
[Clang 6.0 (clang-600.0.57)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import contextvars | |
>>> foo = contextvars.ContextVar("foo") | |
>>> foo.set("a") | |
<Token var=<ContextVar name='foo' at 0x10ccbe2b0> at 0x10ccc36c0> | |
>>> bar = contextvars.ContextVar("bar", default="b") | |
>>> list(contextvars.copy_context().keys()) | |
[<ContextVar name='foo' at 0x10ccbe2b0>] |
Author
pfreixes
commented
Feb 17, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment