Wander Lairson Costa <[email protected]> writes: > Initialize loop variable `i` before the for loop in abbreviate_atoms > function to fix pyright static type checker error. The previous code > left `i` potentially unbound in edge cases where the range could be > empty, though this would not occur in practice since the loop always > executes at least once with the given range parameters. > > The initialization to zero ensures that `i` has a defined value before > entering the loop scope, satisfying static analysis requirements > while preserving the existing logic. The for loop immediately assigns > i to the first value from the range, so the initialization value is > never actually used in normal execution paths. > > This change resolves the pyright reportPossiblyUnbound error without > altering the function's behavior or performance characteristics. > > Signed-off-by: Wander Lairson Costa <[email protected]>
I understand this is just to suppress a false warning, not fixing real problem. Reviewed-by: Nam Cao <[email protected]>
