On Sun, Aug 13, 2017 at 3:14 PM, Nathaniel Smith <n...@pobox.com> wrote: > On Sun, Aug 13, 2017 at 9:57 AM, Yury Selivanov <yselivanov...@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 _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/