On Mon, 20 Jun 2022 at 18:42, Steve Jorgensen <stevec...@gmail.com> wrote: > > Steven D'Aprano wrote: > > Okay, I'm convinced. > > If we need this feature (and I'm not convinced about that part), then it > > makes sense to keep the star and write it as `spam, eggs, *... = items`. > > I thought about that, but to me, there are several reasons to not do that and > to have the ellipsis mean multiple rather than prepending * for that: > 1. In common usage outside of programming, the ellipsis means a continuation > and not just a single additional thing. > 2. Having `*...` mean any number of things implies that `...` means a single > thing, and I don't think there is a reason to match 1 thing but not assign it > to a variable. It is also already fine to repeat `_` in the left side > expression. > 3. I am guessing (though I could be wrong) that support for `*...` would be a > bigger change and more complicated in the Python source code.
Also, while I can't speak for others, I found that when writing examples for posts here, the "*" in "*..." has too strong of a connection with "consume", and I *still* naturally read *... as "consume the rest" (even though it's not currently valid syntax, and the rules for what it *does* mean would be clear and unambiguous, etc etc). So for me at least, any syntax that uses a * would be too easy to misread. Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/EMZZUSIJYNGV4KM75MF66UPHF3K6DOH7/ Code of Conduct: http://python.org/psf/codeofconduct/