pub fn from_result(vm: &VirtualMachine, res: PyResult) -> PyResult<Self> {
        match res {
            Ok(val) => Ok(ExecutionResult::Yield(val)),
            Err(err) => {
                if objtype::isinstance(&err, &vm.ctx.exceptions.stop_iteration) {
                    objiter::stop_iter_value(vm, &err).map(ExecutionResult::Return)
                } else {
                    Err(err)
                }
            }
        }
    }
/// Extract an ExecutionResult from a PyResult returned from e.g. gen.__next__() or gen.send()
Extract an ExecutionResult from a PyResult returned from e.g.
Extract an ExecutionResult from a PyResult returned from e . g .
pub fn from_result(vm: &VirtualMachine, res: PyResult) -> PyResult<Self> {
        match res {
            Ok(val) => Ok(ExecutionResult::Yield(val)),
            Err(err) => {
                if objtype::isinstance(&err, &vm.ctx.exceptions.stop_iteration) {
                    objiter::stop_iter_value(vm, &err).map(ExecutionResult::Return)
                } else {
                    Err(err)
                }
            }
        }
    }
pub fn from_result ( vm : & VirtualMachine , res : PyResult ) -> PyResult < Self > { match res { Ok ( val ) => Ok ( ExecutionResult :: Yield ( val ) ) , Err ( err ) => { if objtype :: isinstance ( & err , & vm . ctx . exceptions . stop_iteration ) { objiter :: stop_iter_value ( vm , & err ) . map ( ExecutionResult :: Return ) } else { Err ( err ) } } } }
Extract an ExecutionResult from a PyResult returned from e.g.
Extract an ExecutionResult from a PyResult returned from e . g .
vm
&VirtualMachine
res
PyResult