Hum, now I'm confused. I was probably confused by ContextVar.get() differences with Context.get().
It's fine if it behaves with a dict. Victor Le 9 janv. 2018 12:02 AM, "Nathaniel Smith" <n...@pobox.com> a écrit : > On Mon, Jan 8, 2018 at 2:35 PM, Victor Stinner <victor.stin...@gmail.com> > wrote: > > ctx[var] raises an exception but ctx.get(var) returns None in such case. > My > > point is just that Context.get() behaves differently than dict.get(). If > > dict[key] raises, I expect that dict.get() raises too and that I have to > > write explicitely dict.get(default=None). > > But that's not how dict.get works? > > In [1]: d = {} > > In [2]: print(d.get(1)) > None > > -n > > -- > Nathaniel J. Smith -- https://vorpus.org >
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com