fix: align range loop behavior with Python range

This commit is contained in:
copilot-swe-agent[bot]
2026-07-08 01:22:52 +00:00
committed by GitHub
parent 0a2b28cb03
commit d08d55cc35
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -28,9 +28,9 @@ class SimpleForLoopRange:
def INPUT_TYPES(s):
return {
"required": {
"start": ("INT", {"default": 0, "min": 0, "max": 10000, "step": 1}),
"stop": ("INT", {"default": 10, "min": 0, "max": 10000, "step": 1}),
"step": ("INT", {"default": 1, "min": 1, "max": 10000, "step": 1}),
"start": ("INT", {"default": 0, "min": -10000, "max": 10000, "step": 1}),
"stop": ("INT", {"default": 10, "min": -10000, "max": 10000, "step": 1}),
"step": ("INT", {"default": 1, "min": -10000, "max": 10000, "step": 1}),
}
}
@@ -41,5 +41,7 @@ class SimpleForLoopRange:
CATEGORY = "Loop"
def execute(self, start, stop, step):
if step == 0:
raise ValueError("step must not be 0")
range_vals = list(range(start, stop, step))
return (range_vals,)