Closed as not planned
Description
Feature or enhancement
I propose to add a new decorator, @thread
, to threading. When called, a decorated function will start in its own thread and return the new thread to the caller.
Pitch
I find it awkward to write
t = threading.Thread (target = target, args = <something>, kwargs= <something>)
t.start ()
...
t.join ()
every time I want to run something in a new thread. It's especially awkward if the only calls to the target are from new threads. Instead, I'd prefer to write
@threading.thread
def target (n):
print ("Hello" * n)
t = target (3)
...
t.join ()
Metadata
Metadata
Assignees
Projects
Status
Done