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/2018-January/151811.html below:

[Python-Dev] PEP 567 v3

[Python-Dev] PEP 567 v3Antoine Pitrou solipsis at pitrou.net
Thu Jan 18 03:03:52 EST 2018
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 the
> `Offloading execution to other threads`_ example would work with
> a ``ProcessPoolExecutor`` too.
> 
> Enabling this is problematic because of the following reasons:
> 
> 1. ``ContextVar`` objects do not have ``__module__`` and
>    ``__qualname__`` attributes, making straightforward pickling
>    of ``Context`` 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
>    to ``ContextVar`` constructor.
> 
> 2. Not all context variables refer to picklable objects.  Making a
>    ``ContextVar`` 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.
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