Matsuoka Takuo writes:
> >>> *(1,2),
> (1, 2)
Yes, this works, and now that I see you just want that to work in
"a[*(1,2),]", I agree, I don't know why that is a syntax error. This
works, of course:
t = *(1,2),
a[t]
(in the sense that if a is a sequence you get a TypeError because the
index isn't an integer or slice, but if it's a mapping you'll get the
value corresponding to (1,2) or a KeyError because it's not in the
mapping). I think it's not good that "a[*(1,2),]" gives a SyntaxError,
but I don't know why it was made that way in the first place.
> 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 don't have time to go into that tonight but if the appropriate
thread gets takeup I'll comment there. You could promote the issue by
submitting a merge request.
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/XPBMDKG3AUM42EBO2CAKCAYY42FMREFG/
Code of Conduct: http://python.org/psf/codeofconduct/