No threading.start_new_thread(), useful addition?

Laszlo Nagy gandalf at shopzeus.com
Sat Oct 10 05:42:03 EDT 2009


Christian Heimes wote:
> Laszlo Nagy wrote:
>   
>> IMHO it is much cleaner to implement this as a decorator. Pro: 
>> transparent passing of positional and keyword arguments, keeps function 
>> documentation.
>>     
>
> You are entitled to your opinion but I STRONGLY recommend against your
> decorator. You MUST NOT start threads as a side effect of a module
> import.
That decorator will not start threads at module import time, except if 
you call the decorated function at module import time. I trust your 
opinion, and I won't call such decorated functions at import time. :-)

  L



More information about the Python-list mailing list