Skip to content

Commit a968ded

Browse files
committed
allow long argument as slice stop (wrap around is fine here)
1 parent a78a484 commit a968ded

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/subscript/SliceLiteralNode.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public PSlice doSlice(@SuppressWarnings("unused") PNone start, int stop, @Suppre
8888
return factory().createSlice(MISSING_INDEX, stop, MISSING_INDEX);
8989
}
9090

91+
@Specialization
92+
public PSlice doSlice(@SuppressWarnings("unused") PNone start, long stop, @SuppressWarnings("unused") PNone step) {
93+
return factory().createSlice(MISSING_INDEX, (int) stop, MISSING_INDEX);
94+
}
95+
9196
@Specialization
9297
public PSlice doSlice(@SuppressWarnings("unused") PNone start, @SuppressWarnings("unused") PNone stop, int step) {
9398
return factory().createSlice(MISSING_INDEX, MISSING_INDEX, step);

0 commit comments

Comments
 (0)