<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 28, 2017 at 9:26 AM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org" target="_blank">barry@python.org</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 Aug 28, 2017, at 11:50, Yury Selivanov <<a href="mailto:yselivanov.ml@gmail.com">yselivanov.ml@gmail.com</a>> wrote:<br>
<br>
> For checking if a context variable has a value in the topmost LC, we<br>
> can add two new keyword arguments to the "ContextVar.lookup()" method:<br>
><br>
>   ContextVar.lookup(*, default=None, topmost=False)<br>
><br>
> If `topmost` is set to `True`, `lookup` will only check the topmost LC.<br>
><br>
> For deleting a value from the topmost LC we can add a new<br>
> "ContextVar.delete()" method.<br>
<br>
</span>+1<span class="HOEnZb"></span><br></blockquote></div></div><div class="gmail_extra">Yes, that's the only way. (Also forgive me for ever having proposed lookup() -- I think we should go back to get(), set(), delete(). Things will then be similar to getattr/setattr/delattr for class attributes.<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>