E-CE0010 — Step of a slice or range is zero

Error Type

Compile Error

Phase

compiling the problem into an OMMX instance

Python exception

ValueError (builtin)

Message

The step of a {construct} cannot be zero.

Possible fix: use a non-zero step.

Cause

A slice such as x[a:b:0] or a range such as jm.range(a, b, 0) was evaluated with a step of 0. A zero step would never advance, so it is rejected, matching Python’s own slicing and range rules. The step is checked when the slice or range is evaluated to concrete values during compilation, so a computed step expression triggers this error only when the instance data makes it zero. An omitted slice step defaults to 1 and never triggers this error.

Fix

Use a non-zero step. If the step is a computed expression, ensure it cannot evaluate to zero for any instance data.