def defer(callable):
    '''Defers execution of the callable to a thread.

    For example:

        >>> def foo():
        ...     print('bar')
        >>> join = defer(foo)
        >>> join()
    '''
    t = threading.Thread(target=callable)
    t.start()
    return t.join
Defers execution of the callable to a thread.

    For example:

        >>> def foo():
        ...     print('bar')
        >>> join = defer(foo)
        >>> join()