def patch(target, value): """ Replace the specified object :param str target: A string pointing to the target to patch. :param object value: The value to replace the target with. :return: A ``Patch`` object. """ patch = current_space().patch_for(target) patch.set_value(value) return patch
def __init__(self, target): """ :param object target: The object to wrap. """ self._proxy = current_space().proxy_for(target)
def push_thread_space_to_queue(queue): queue.put(lifecycle.current_space())