Dear Steve, Thank you for your detailed explanation.
(i.e., it can be mistyped as "s[1,2,]" but without SyntaxError this time). It would at least be consistent if we got SyntaxError in both cases (namely, the syntax allowed only a single Python expression here), but if we don't want SyntaxError in the latter case, how may we want it in the former case?
I defy you to explain how the compiler or interpreter can distinguish any of those stipulated programmer errors from intended programs.
Sure, if you ever want any error raised in those cases, that's going to be SyntaxError to be always raised regardless of the programmer's intention. That's fine. But then if you don't want SyntaxError in the "latter" case, it in fact means you never want any error raised since SyntaxError is the only thing you could hope for anyway. So I could equivalently have asked "if we never want any error raised in the latter case, how may we want some error raised at least sometimes in the former case?". This may have been clearer to you, but it's an equivalent question. Anyway, I assume everything you say about "*(1,2)" is right, but it's not "*(1,2)" that I wanted to create an object, but, as I have indicated, it's things like "*iterable , " (with comma!), where the iterable may be "(1,2)". Just as in "1,2", the comma indicates the intention to create an object. For example,
*(1,2), (1, 2)
and another example:
*(), *(1,2) (1, 2)
I find it unfortunate SyntaxError you got with
*(1,2)
says "can't use starred expression here" since "*(1,2)" is not really a "starred expression" as defined in the Language Reference. I think this should be fixed, so have started a new thread on that, titled '''SyntaxError says: "can't use starred expression here", but its not the same "starred expression" defined in the Language Reference''', You are invited to comment on that! Best regards, Takuo