• H
    [Dy2stat] Add Support for a, b = static_variable Grammar (#33499) · aa50868f
    Huihuang Zheng 提交于
    For python, if users write `a, b = var`, the `__getitem__` method will iterate through 0, 1, 2 ... until `__getitem__` throws an IndexError, then stop. The var[0], var[1] will be given to a, b respectively. If more values are given, the unpack size would cause error.
    
    We didn't raise the IndexError in the past and we add statement in `__getitem__` to raise IndexError here to support grammar like `a, b = var` in this PR.
    aa50868f
variable_index.py 13.2 KB