<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><span style="font-family:arial,sans-serif">On Tue, Sep 5, 2017 at 1:20 AM, Oleg Broytman </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:phd@phdru.name" target="_blank">phd@phdru.name</a>></span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<span class="gmail-"><br>
On Tue, Sep 05, 2017 at 12:50:35AM +0300, Koos Zevenhoven <<a href="mailto:k7hoven@gmail.com">k7hoven@gmail.com</a>> wrote:<br>
>     cvar = contextvars.Var(default="the default value",<br>
>                            description="example context variable")<br>
<br>
</span>   Why ``description`` and not ``doc``?<br>
<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​Cause that's a nice thing to bikeshed about? In fact, I probably should have left it out at this point.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">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.</div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>     with cvar.assign(new_value):<br>
<br>
   Why ``assign`` and not ``set``?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​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". </div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">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.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-"><br>
> Each thread of the Python interpreter keeps its on stack of<br>
<br>
</span>   "its own", I think.<br></blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​That's right, thanks.​</div><br></div><div><div class="gmail_default" style="font-family:monospace,monospace">​––Koos​</div><br></div></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">+ Koos Zevenhoven + <a href="http://twitter.com/k7hoven" target="_blank">http://twitter.com/k7hoven</a> +</div>
</div></div>