19 Jun
2021
19 Jun
'21
9:08 a.m.
19.06.21 07:33, Guido van Rossum пише:
[1] Does the unary star operator have a name when used like this in Python? In JavaScript the equivalent syntax ("...chunk", where the "..." are a literal ellipsis) is called "spread". We could borrow this term.
I would not call is an operator. Operator forms an expression, but *x is not an expression. It is not more operator than colon. Is there such term as "syntax form" in English? I would call *x, x for x in a, x:y syntax forms. They are not expressions, but can be part of expression. They can only be used in some context, and the meaning depends on the context (x:y are two different things in {x:y} and in a[x:y]).