Threaded decorators which return objects

You can't. In order for a call to be able to return a value, it must block.

Also, you can't create dialogs from separate threads in wx.

···

On Oct 29, 2007 6:03 PM, Frank Aune <Frank.Aune@broadpark.no> wrote:

Hi,

How do I make a threaded decorator:

def Threaded(f):
    """ Decorator function to spawn methods into separate threads """
    def wrapper(*args, **kwargs):
        t=threading.Thread(target=f, args=args, kwargs=kwargs)
        t.setDaemon(True)
        t.start()
    return wrapper

return values to its caller? Say I create a MessageDialog in a decorated
function, and want to receive the dlg value from the above wrapper.