On Tue, Sep 5, 2017 at 1:20 AM, Oleg Broytman <p...@phdru.name> wrote:

> Hi!
>
> On Tue, Sep 05, 2017 at 12:50:35AM +0300, Koos Zevenhoven <
> k7ho...@gmail.com> wrote:
> >     cvar = contextvars.Var(default="the default value",
> >                            description="example context variable")
>
>    Why ``description`` and not ``doc``?
>
>
​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.



> >     with cvar.assign(new_value):
>
>    Why ``assign`` and not ``set``?
>

​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.​

​––Koos​



-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to