Skip to content

Commit 801de6c

Browse files
committed
Export lengthWithState and isTrueWithState in PIntRange
1 parent eb8595a commit 801de6c

File tree

1 file changed

+6
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/range

1 file changed

+6
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/range/PIntRange.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected boolean withStep() {
111111
}
112112

113113
@ExportMessage
114-
public int length() {
114+
public int lengthWithState(@SuppressWarnings("unused") ThreadState state) {
115115
return length;
116116
}
117117

@@ -120,6 +120,11 @@ public boolean isTrue() {
120120
return length != 0;
121121
}
122122

123+
@ExportMessage
124+
public boolean isTrueWithState(@SuppressWarnings("unused") ThreadState state) {
125+
return length != 0;
126+
}
127+
123128
/* this is correct because it cannot be subclassed in Python */
124129
@ExportMessage
125130
PIntRangeIterator getIteratorWithState(@SuppressWarnings("unused") ThreadState threadState,

0 commit comments

Comments
 (0)