Dj Gilcrease wrote:

executor = executors.create(NAME, *args, **kwargs) # NAME is 'process'
or 'thread' by default

from concurrent.futures import executors, ExecutorBase
class MyExecutor(ExecutorBase): ...
executors.register(NAME, MyExecutor)

I don't understand the reason for using a registration system
rather than just importing names from a module.

You mentioned wanting to globally change the executor class
being used by a program without having to make changes throughout.
Registering a different class under the same name would be one
way to do that, but you could achieve the same thing just by
assigning to a name in a module.

In other words, instead of inventing your own mechanism for
managing a namespace, just use a module as your namespace.

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

Reply via email to