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/2010-March/098318.html below:

[Python-Dev] [PEP 3148] futures - execute computations asynchronously

[Python-Dev] [PEP 3148] futures - execute computations asynchronously [Python-Dev] [PEP 3148] futures - execute computations asynchronouslyGreg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 8 23:03:47 CET 2010
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
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