On Mon, Aug 28, 2017 at 9:26 AM, Barry Warsaw <barry at python.org> wrote: > On Aug 28, 2017, at 11:50, Yury Selivanov <yselivanov.ml at gmail.com> wrote: > > > For checking if a context variable has a value in the topmost LC, we > > can add two new keyword arguments to the "ContextVar.lookup()" method: > > > > ContextVar.lookup(*, default=None, topmost=False) > > > > If `topmost` is set to `True`, `lookup` will only check the topmost LC. > > > > For deleting a value from the topmost LC we can add a new > > "ContextVar.delete()" method. > > +1 > 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. -- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170828/03aad91a/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4