fn inner_getitem_option<K: DictKey + IntoPyObject + Copy>(
        &self,
        key: K,
        vm: &VirtualMachine,
    ) -> PyResult<Option<PyObjectRef>> {
        if let Some(value) = self.entries.borrow().get(vm, key)? {
            return Ok(Some(value));
        }

        if let Some(method_or_err) = vm.get_method(self.clone().into_object(), "__missing__") {
            let method = method_or_err?;
            Ok(Some(vm.invoke(&method, vec![key.into_pyobject(vm)?])?))
        } else {
            Ok(None)
        }
    }
/// Return an optional inner item, or an error (can be key error as well)
Return an optional inner item, or an error (can be key error as well)
Return an optional inner item or an error ( can be key error as well )
fn inner_getitem_option<K: DictKey + IntoPyObject + Copy>(
        &self,
        key: K,
        vm: &VirtualMachine,
    ) -> PyResult<Option<PyObjectRef>> {
        if let Some(value) = self.entries.borrow().get(vm, key)? {
            return Ok(Some(value));
        }
        if let Some(method_or_err) = vm.get_method(self.clone().into_object(), "__missing__") {
            let method = method_or_err?;
            Ok(Some(vm.invoke(&method, vec![key.into_pyobject(vm)?])?))
        } else {
            Ok(None)
        }
    }
fn inner_getitem_option < K : DictKey + IntoPyObject + Copy > ( & self , key : K , vm : & VirtualMachine , ) -> PyResult < Option < PyObjectRef > > { if let Some ( value ) = self . entries . borrow ( ) . get ( vm , key ) ? { return Ok ( Some ( value ) ) ; } if let Some ( method_or_err ) = vm . get_method ( self . clone ( ) . into_object ( ) , " " ) { let method = method_or_err ? ; Ok ( Some ( vm . invoke ( & method , vec ! [ key into_pyobject ( vm ) ] ) ? ) ) } else { Ok ( None ) } }
Return an optional inner item, or an error (can be key error as well)
Return an optional inner item or an error ( can be key error as well )
&self
key
K
vm
&VirtualMachine