Dec-02-2023, 11:50 PM
(Nov-30-2023, 02:51 PM)Gribouillis Wrote:*x
is not a valid Python expression, it cannot be evaluated. What would its value be? On the other handfunc(*x)
is a valid expression. There is no unary operator*
or**
.
Thank you. I originally thought it was a unary operator that would unpack x. But then that unary operator would be a function and functions return scalars or tuples, a pack not unpack of results. If not a unary operator than what? Your response made me think. It seems like * and ** are part of the language syntax and the language parser treats them like an operator in certain cases. Thank you.