On Sat, Aug 26, 2017 at 1:10 PM, David Mertz <me...@gnosis.cx> wrote:
> Would it be possible/desirable to make the default a unique string value
> like a UUID or a stringified counter?

Sure, or we could just use the id of ContextVar.

In the end, when we want to introspect the EC while debugging, we
would see something like this:

{
   ContextVar(name='518CDD4F-D676-408F-B968-E144F792D055'): 42,
   ContextVar(name='decimal_context'): DecimalContext(precision=2),
   ContextVar(name='7A44D3BE-F7A1-40B7-BE51-7DFFA7E0E02F'): 'spam'
}

That's why I think it's easier to force users always specify the name:

    my_var = sys.new_context_var('my_var')

This is similar to namedtuples, and nobody really complains about them.

Yury
_______________________________________________
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

Reply via email to