From b875f40910c6784408e7503f63b3e12ef5ea22bb Mon Sep 17 00:00:00 2001 From: Lucas Mirelmann Date: Fri, 6 Feb 2026 22:05:07 +0100 Subject: [PATCH] Allow negative indexes in list.pop Negative indexes are already allowed in Bazel, star lark-go and Python (did not check starlark-rust) as long as they follow the index conventions. --- spec.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.md b/spec.md index b99b3c6..a18e2ec 100644 --- a/spec.md +++ b/spec.md @@ -3939,10 +3939,10 @@ x # ["a", "b", "c", "d", "e"] ### list·pop `L.pop([index])` removes and returns the last element of the list L, or, -if the optional index is provided, at that index. +if the optional index is provided, at that index according to Starlark's +[indexing conventions](#indexing). -`pop` fails if the index is negative or not less than the length of -the list, of if the list is frozen or has active iterators. +`pop` fails if the list is frozen or has active iterators. ```python x = [1, 2, 3]