[Python-Dev] PEP 567 v3 (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Thu Jan 18 03:03:52 EST 2018
- Previous message (by thread): [Python-Dev] PEP 567 v3
- Next message (by thread): [Python-Dev] PEP 567 v3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 17 Jan 2018 20:53:42 -0500 Yury Selivanov <yselivanov.ml at gmail.com> wrote:
Proposed by Antoine Pitrou, this could enable transparent cross-process use of
Context
objects, so theOffloading execution to other threads
example would work with aProcessPoolExecutor
too. Enabling this is problematic because of the following reasons: 1.ContextVar
objects do not have_module_
and_qualname_
attributes, making straightforward pickling ofContext
objects impossible. This is solvable by modifying the API to either auto detect the module where a context variable is defined, or by adding a new keyword-only "module" parameter toContextVar
constructor. 2. Not all context variables refer to picklable objects. Making aContextVar
picklable must be an opt-in.
This is a red herring. If a value isn't picklable, pickle will simply raise as it does in other contexts. You should't need to opt in for anything here.
Regards
Antoine.
- Previous message (by thread): [Python-Dev] PEP 567 v3
- Next message (by thread): [Python-Dev] PEP 567 v3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]