A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-August/149009.html below:

[Python-Dev] Pep 550 and None/masking

[Python-Dev] Pep 550 and None/maskingYury Selivanov yselivanov.ml at gmail.com
Mon Aug 28 11:50:04 EDT 2017
On Sun, Aug 27, 2017 at 4:01 PM, Nathaniel Smith <njs at pobox.com> wrote:
> I believe that the current status is:
>
> - assigning None isn't treated specially – it does mask any underlying
> values (which I think is what we want)

Correct.

>
> - there is currently no way to "unmask"
>
> - but it's generally agreed that there should be a way to do that, at least
> in some cases, to handle the save/restore issue I raised. It's just that
> Yury & Elvis wanted to deal with restructuring the PEP first before doing
> more work on the api details.

Yes. I think it's a good time to start a discussion about this, I can
list a couple ideas here.

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.

Yury
More information about the Python-Dev mailing list

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