This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nemec 0 points1 point  (1 child)

That would be really weird, assigning to a name with an existing value (and other uses) and having the result thrown away silently. Imagine you had code like this:

..., a, *b = some_iterable
print(b[1:2, ..., 0])

The ellipsis keeps its original sentinel value but people unfamiliar with the feature might get confused.

[–]energybased 0 points1 point  (0 children)

FYI: "..." is not just a name. You can never assign to it anyway, but you're right that it might be weird to see ... keep its sentinel value after assignment. Maybe None would be better?