Skip to content

Commit af0b633

Browse files
committed
fix repr for methods
1 parent dec8706 commit af0b633

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ Object reprBuiltinMethod(PBuiltinMethod self,
9191
@Cached("create()") GetLazyClassNode getClassNode) {
9292
return String.format("<built-in method %s of %s object at 0x%x>", self.getName(), getClassNode.execute(self.getSelf()).getName(), self.hashCode());
9393
}
94+
95+
@Specialization(guards = "!isBuiltinFunction(self)")
96+
@TruffleBoundary
97+
Object reprBuiltinMethod(PMethod self,
98+
@Cached("create()") GetLazyClassNode getClassNode) {
99+
return String.format("<built-in method %s of %s object at 0x%x>", self.getName(), getClassNode.execute(self.getSelf()).getName(), self.hashCode());
100+
}
94101
}
95102

96103
@Builtin(name = __REDUCE__, fixedNumOfPositionalArgs = 1)

0 commit comments

Comments
 (0)