(original) (raw)
I think we should let the naming issue go for now, while Yury et al. are rewriting the PEP. We'll revisit it after we're more comfortable with the semantics.
On Thu, Aug 24, 2017 at 9:55 PM, Nick Coghlan <ncoghlan@gmail.com> wrote:
On 25 August 2017 at 01:00, Guido van Rossum <guido@python.org> wrote:
\> It shouldn't be called a namespace unless the dominant access is via
\> attributes.
That makes sense.
Since the main purpose of that part of the Python API is to offer an
opaque handle to where the context locals store their values,
something semantically neutral like "State" may work:
\- ContextLocal: read/write API
\- ContextLocalState: where ContextLocal instances actually store things
\- ExecutionContext: nested stack of context local states
The attribute on generators and coroutines could then be called
"\_\_context\_locals\_\_", and that would either be None (indicating that
any context local references will just use the already active context
local storage), or else it would be set to a ContextLocalState
instance (indicate that starting & stopping the operation will push &
pop the given context local state).
--
--Guido van Rossum (python.org/\~guido)