Yury Selivanov <yseliva...@gmail.com> added the comment:

So we're deprecating passing non-ThreadPoolExecutor instances to 
loop.set_default_executor.  In 3.9 that will trigger an error.

For this issue we have basically the next few options:

(1) Do nothing;

(2) Fix "run_in_executor" to start copying and running in correct context 
automatically

(3) Add a new keyword-only parameter to "run_in_executor": 
"retain_context=False"

(4) Design a new async/await friendly API for using thread- and process-pools.

Now, (4) will happen.  The "run_in_executor" method is low-level and requires 
accessing the event loop to use it.  We probably have enough time to design 
this new API before 3.8.

As for implementing (3) in 3.8 -- I'd be OK with that too.  Andrew, your 
thoughts?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to