Python.Runtime.MethodBinding.tp_hash C# (CSharp) Method

tp_hash() private method

private tp_hash ( IntPtr ob ) : IntPtr
ob System.IntPtr
return System.IntPtr
	public static IntPtr tp_hash(IntPtr ob) {
	    MethodBinding self = (MethodBinding)GetManagedObject(ob);
	    long x = 0;
	    long y = 0;

	    if (self.target != IntPtr.Zero) {
		x = Runtime.PyObject_Hash(self.target).ToInt64();
		if (x == -1) {
		    return new IntPtr(-1);
		}
	    }
 
	    y = Runtime.PyObject_Hash(self.m.pyHandle).ToInt64();
	    if (y == -1) {
		return new IntPtr(-1);
	    }

	    x ^= y;

	    if (x == -1) {
		x = -1;
	    }

	    return new IntPtr(x);
	}