コード例 #1
0
ファイル: PythonObject.cs プロジェクト: ramasedi/Torch.NET
        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));
        }
コード例 #2
0
ファイル: PythonObject.cs プロジェクト: iamcurrent/MineCode
        }                            // 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));
        }
コード例 #3
0
 public bool CanDecode(PyObject objectType, Type targetType)
 => this.CanEncode(targetType) && objectType.Equals(PythonEngine.Eval("ValueError"));