<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 5, 2018 at 3:10 AM, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5 January 2018 at 11:06, Victor Stinner <<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>> wrote:<br>
>> Le 5 janv. 2018 11:42 AM, "Paul Moore" <<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>> a écrit :<br>
>> """<br>
</span><span class="">>> A Context is a mapping from ContextVar objects to their values. The<br>
>> Context itself exposes the Mapping interface, so cannot be modified<br>
>> directly - to modify the value associated with a variable you need to<br>
>> use the ContextVar.set() method.<br>
>> """<br>
>><br>
>> Does that explain things correctly? One thing I am sure of is that we<br>
>> should remove "implemented using an immutable dictionary" - it's an<br>
>> implementation detail, and adds nothing but confusion to mention it<br>
>> here.<br>
<br>
</span><span class="">> You can only modify a context when it's the current context, so using<br>
> ContextVar.set() in Context.run().<br>
<br>
</span>Thanks. That's a useful qualification. But it may be too detailed for<br>
the summary - it's certainly something that should be covered in the<br>
specification section, though. Maybe "...  you need to use the<br>
ContextVar.set() method from Context.run()" would be OK, although I<br>
don't want the summary to get too long.<span class="HOEnZb"></span><br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">(Sorry, I wrote my previous response before seeing this part of the exchange.)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Maybe "... you need to use the ContextVar.set() method, which modifies the current context."</div><div class="gmail_extra"><br></div><div class="gmail_extra">Then we also need to update the summary for ContextVar.set(), which currently IMO is plain wrong.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>