Message10586

Author zyasoft
Recipients lsenta, zyasoft
Date 2016-01-05.04:43:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451969035.35.0.350466948433.issue2451@psf.upfronthosting.co.za>
In-reply-to
Content
Just missing the appropriate support so that Object#hashCode is not invoked (the hash code is defined for all objects in Java, unlike Python). Simply following the example of PyByteArray (which implements bytearray), we get the following patch:

+    @Override
+    public int hashCode()
+        return array___hash__();
+    }
+
+    @ExposedMethod
+    final int array___hash__() {
+        throw Py.TypeError(String.format("unhashable type: '%.200s'", getType().fastGetName()));
+    }
+

Just need to add a test to complete.
History
Date User Action Args
2016-01-05 04:43:55zyasoftsetmessageid: <1451969035.35.0.350466948433.issue2451@psf.upfronthosting.co.za>
2016-01-05 04:43:55zyasoftsetrecipients: + zyasoft, lsenta
2016-01-05 04:43:55zyasoftlinkissue2451 messages
2016-01-05 04:43:54zyasoftcreate