def _fun(*args): t = Thread(target=fun, args=args) t.__setattr__('__chan__', chan) t.start() return chan