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

[Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)

[Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)Paul Moore p.f.moore at gmail.com
Thu Aug 24 10:56:24 EDT 2017
On 24 August 2017 at 15:38, Barry Warsaw <barry at python.org> wrote:
> Yes, but in conversations about Python, the term “context” (in the context of context managers) comes up way more often than the term “scope”.  I actually think Python’s scoping rules are fairly easy to grasp, as there aren’t that many levels or ways to access them, and the natural, common interactions are basically implicit when thinking about the code you’re writing.
>
> So while “context”, “environment”, and “scope” are certainly overloaded terms in Python, the first two have very specific existing, commonplace constructs within Python, and “scope” is both the least overloaded of the three and most closely matches what is actually going on.
>
> A different tack would more closely align with PEP 550’s heritage in thread-local storage, calling these things “execution storage”.  I think I read Guido suggest elsewhere using a namespace here so that in common code you’d only have to change the “threading.local()” call to migrate to PEP 550.  It might be neat if you could do something like:

I strongly agree with Barry's reservations about using the term
"context" here. I've not been following the discussion (I was away
when it started and there's too many emails to go through to catch up)
but I've found the use of the term "context" to be a particular
problem in trying to understand what's going on just skimming the
messages.

I don't have a strong opinion on what name should be used, but I am
definitely against using the term "context".

Paul
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