On Tue, 16 Jan 2018 17:18:06 -0800
Nathaniel Smith <n...@pobox.com> wrote:
> On Tue, Jan 16, 2018 at 5:06 PM, Yury Selivanov <yselivanov...@gmail.com> 
> wrote:
> >
> > I think it would be a very fragile thing In practice: if you have even
> > one variable in the context that isn't pickleable, your code that uses
> > a ProcessPool would stop working.  I would defer Context pickleability
> > to 3.8+.  
> 
> There's also a more fundamental problem: you need some way to match up
> the ContextVar objects across the two processes, and right now they
> don't have an attached __module__ or __qualname__.

They have a name, though.  So perhaps the name could serve as a unique
identifier?  Instead of being serialized as a bunch of ContextVars, the
Context would then be serialized as a {name: value} dict.

Regards

Antoine.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to