public override bool Equals(object obj) { switch (obj) { case PythonObject other: return(self.Equals(other.self)); case PyObject other: return(self.Equals(other)); } return(base.Equals(obj)); }
} // required for some constructors public override bool Equals(object obj) { if (obj == null) { return(false); } switch (obj) { case PythonObject other: return(self.Equals(other.self)); case PyObject other: return(self.Equals(other)); } return(base.Equals(obj)); }
public bool CanDecode(PyObject objectType, Type targetType) => this.CanEncode(targetType) && objectType.Equals(PythonEngine.Eval("ValueError"));