[Python-ideas] @run_as_thread decorator

Antoine Pitrou solipsis at pitrou.net
Sat Mar 5 20:31:18 CET 2011


Le samedi 05 mars 2011 à 20:25 +0100, Giampaolo Rodolà a écrit :
> from utils import run_as_thread
> 
> class Admin:
> 
>     @run_as_thread
>     def refresh_persons(self):
>         ...

That strikes me as a bad idea, because another module or library calling
refresh_persons() has no clue that this implictly starts a separate
thread (instead of being a "normal" method).

Regards

Antoine.





More information about the Python-ideas mailing list