pub fn into_result(self, vm: &VirtualMachine) -> PyResult {
        match self {
            ExecutionResult::Yield(value) => Ok(value),
            ExecutionResult::Return(value) => {
                let stop_iteration = vm.ctx.exceptions.stop_iteration.clone();
                let args = if vm.is_none(&value) {
                    vec![]
                } else {
                    vec![value]
                };
                Err(vm.new_exception_obj(stop_iteration, args).unwrap())
            }
        }
    }
/// Turn an ExecutionResult into a PyResult that would be returned from a generator or coroutine
Turn an ExecutionResult into a PyResult that would be returned from a generator or coroutine
Turn an ExecutionResult into a PyResult that would be returned from a generator or coroutine
pub fn into_result(self, vm: &VirtualMachine) -> PyResult {
        match self {
            ExecutionResult::Yield(value) => Ok(value),
            ExecutionResult::Return(value) => {
                let stop_iteration = vm.ctx.exceptions.stop_iteration.clone();
                let args = if vm.is_none(&value) {
                    vec![]
                } else {
                    vec![value]
                };
                Err(vm.new_exception_obj(stop_iteration, args).unwrap())
            }
        }
    }
pub fn into_result ( self , vm : & VirtualMachine ) -> PyResult { match self { ExecutionResult :: Yield ( value ) => Ok ( value ) , ExecutionResult :: Return ( value ) => { let stop_iteration = vm . ctx . exceptions . stop_iteration . clone ( ) ; let args = if vm . is_none ( & value ) { vec ! [ ] } else { vec ! [ value ] } ; Err ( vm . new_exception_obj ( stop_iteration , args ) . unwrap ( ) ) } } }
Turn an ExecutionResult into a PyResult that would be returned from a generator or coroutine
Turn an ExecutionResult into a PyResult that would be returned from a generator or coroutine
self
vm
&VirtualMachine