Guido van Rossum wrote:
Honestly I think it's fine the way you have implemented it -- since there is a difference between a and a[1,], a[*t] where len(t) == 1 has to make a choice, and it's fine if this always passes a tuple.
Yup, I agree. Not only because it feels more intuitive to me (which is probably why I thoughtlessly implemented the parser this way before Stefano pointed out to me that it contradicted the PEP), but also because it's much simpler to reason about and understand. We don't have to worry about the type of the index varying at runtime based on the length of the unpacked args (empty tuple vs single object vs two-or-more-element tuple). I'm pretty sure that's a big win for static analysis, and I *know* it's a big win for simplifying the implementation.
The "rule" for this is simple. If there's a star-unpacking in the positional arguments, it will always pass a tuple, regardless of the resulting length.