On Tue, Sep 5, 2017 at 1:20 AM, Oleg Broytman firstname.lastname@example.org wrote:
On Tue, Sep 05, 2017 at 12:50:35AM +0300, Koos Zevenhoven email@example.com wrote:
cvar = contextvars.Var(default="the default value", description="example context variable")
description and not
Cause that's a nice thing to bikeshed about? In fact, I probably should have left it out at this point.
Really, it's just to get a meaningful repr for the object and better error messages, without any significance for the substance of the PEP. There are also concepts in the PEP that don't have a name yet.
assign and not
To distinguish from typical set-operations (setattr, setitem), and from sets and from settings. I would rather enter an "assignment context" than a "set context" or "setting context".
One key point of this PEP is to promote defining context variable scopes on a per-variable (and per-value) basis. I combined the variable and value aspects in this concept of Assignment(variable, value) objects, which define a context that one can enter and exit.
Each thread of the Python interpreter keeps its on stack of
"its own", I think.
That's right, thanks.