google/skylark

feature request: allow custom skylark Values to implement the slice operator

nicks opened this issue · 1 comments

nicks commented

in real Python, user-defined classes can implement the slice operator (x[i:j])

in Skylark, the slice operator can only be used on String, List, and Tuple
https://github.com/google/skylark/blob/master/eval.go#L883

would you accept a PR to make this an interface, like other Skylark operators (HasAttrs, etc)?

In principle, yes.