[Python-ideas] New PEP 550: Execution Context

Yury Selivanov yselivanov.ml at gmail.com
Sun Aug 13 16:54:23 EDT 2017


On Sun, Aug 13, 2017 at 3:14 PM, Nathaniel Smith <njs at pobox.com> wrote:
> On Sun, Aug 13, 2017 at 9:57 AM, Yury Selivanov <yselivanov.ml at gmail.com> wrote:
>> 2. ContextItem.has(), ContextItem.get(), ContextItem.set(),
>> ContextItem.delete() -- pretty self-explanatory.
>
> It might make sense to simplify even further and declare that context
> items are initialized to None to start, and the only operations are
> set() and get(). And then get() can't fail, b/c there is no "value
> missing" state.

I like this idea! It aligns with what I wanted to do in PEP 550
initially, but without the awkwardness of "delete on None".  Will add
this to the PEP.

Yury


More information about the Python-ideas mailing list