pub fn call_or_unsupported<F>(
        &self,
        obj: PyObjectRef,
        arg: PyObjectRef,
        method: &str,
        unsupported: F,
    ) -> PyResult
    where
        F: Fn(&VirtualMachine, PyObjectRef, PyObjectRef) -> PyResult,
    {
        if let Some(method_or_err) = self.get_method(obj.clone(), method) {
            let method = method_or_err?;
            let result = self.invoke(&method, vec![arg.clone()])?;
            if !result.is(&self.ctx.not_implemented()) {
                return Ok(result);
            }
        }
        unsupported(self, obj, arg)
    }
/// Calls a method on `obj` passing `arg`, if the method exists.
///
/// Otherwise, or if the result is the special `NotImplemented` built-in constant,
/// calls `unsupported` to determine fallback value.
Calls a method on `obj` passing `arg`, if the method exists.
Otherwise, or if the result is the special `NotImplemented` built-in constant,
calls `unsupported` to determine fallback value.
Calls a method on ` obj ` passing ` arg ` if the method exists . Otherwise or if the result is the special ` NotImplemented ` built - in constant calls ` unsupported ` to determine fallback value .
pub fn call_or_unsupported<F>(
        &self,
        obj: PyObjectRef,
        arg: PyObjectRef,
        method: &str,
        unsupported: F,
    ) -> PyResult
    where
        F: Fn(&VirtualMachine, PyObjectRef, PyObjectRef) -> PyResult,
    {
        if let Some(method_or_err) = self.get_method(obj.clone(), method) {
            let method = method_or_err?;
            let result = self.invoke(&method, vec![arg.clone()])?;
            if !result.is(&self.ctx.not_implemented()) {
                return Ok(result);
            }
        }
        unsupported(self, obj, arg)
    }
pub fn call_or_unsupported < F > ( & self , obj : PyObjectRef , arg : PyObjectRef , method : & str , unsupported : F , ) -> PyResult where F : Fn ( & VirtualMachine , PyObjectRef , PyObjectRef ) -> PyResult , { if let Some ( method_or_err ) = self . get_method ( obj . clone ( ) , method ) { let method = method_or_err ? ; let result = self . invoke ( & method , vec ! [ arg clone ( ) ] ) ? ; if ! result . is ( & self . ctx . not_implemented ( ) ) { return Ok ( result ) ; } } unsupported ( self , obj , arg ) }
Calls a method on `obj` passing `arg`, if the method exists.
Calls a method on ` obj ` passing ` arg ` if the method exists .
&self
obj
PyObjectRef
arg
PyObjectRef
method
&str
unsupported
F