Skip to content

Commit fddd776

Browse files
committed
Add isHashable to P[Builtin]Method
1 parent efca2c5 commit fddd776

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/PBuiltinMethod.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public boolean isCallable() {
6868
return true;
6969
}
7070

71+
@ExportMessage
72+
boolean isHashable() {
73+
return true;
74+
}
75+
7176
@ExportMessage
7277
protected long hashWithState(@SuppressWarnings("unused") ThreadState state) {
7378
return PythonAbstractObject.systemHashCode(this.getSelf()) ^ PythonAbstractObject.systemHashCode(this.getFunction());

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/PMethod.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ protected boolean hasSourceLocation(@CachedLibrary("this.function") InteropLibra
8080
return lib.hasSourceLocation(function);
8181
}
8282

83+
@ExportMessage
84+
boolean isHashable() {
85+
return true;
86+
}
87+
8388
@ExportMessage
8489
protected long hashWithState(@SuppressWarnings("unused") ThreadState state) {
8590
return PythonAbstractObject.systemHashCode(this.getSelf()) ^ PythonAbstractObject.systemHashCode(this.getFunction());

0 commit comments

Comments
 (0)