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/148976.html below:

[Python-Dev] PEP 550 v4

[Python-Dev] PEP 550 v4 [Python-Dev] PEP 550 v4Yury Selivanov yselivanov.ml at gmail.com
Sat Aug 26 13:19:55 EDT 2017
On Sat, Aug 26, 2017 at 1:10 PM, David Mertz <mertz at 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
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