On Sun, Jun 19, 2022 at 12:21:50AM -0700, Lucas Wiman wrote:

> Using either * or / could lead to some odd inconsistencies where a missing
> space is very consequential, eg:
> x, / = foo  # fine
> x, /= foo  # syntax error?
> x / = foo  # syntax error
> x /= foo  # fine, but totally different from the first example.

Good point!

Despite what people say, Python does not actually have significant 
whitespace (or at least, no more than most other languages). It has 
significant *indentation*, which is not quite the same.

So in general, although we *recommend* spaces around the equals sign, 
we shouldn't *require* it.

If `/=` and `/ =` have different meanings, then we shouldn't use the 
slash for this. Likewise for the asterisk `* =`.

> That said, the * syntax feels intuitive in a way that / doesn’t. I’d
> suggest:
> x, *… = foo
> This seems unambiguous and fairly self-explanatory.

"Self-explanatory". This is how we got Perl and APL o_O

What do we need the star for?

    x, *... = items
    x, ... = items

Convince me that adding another meaning for the star symbol is a 
good idea.

(That's assuming that we want the feature at all.)


-- 
Steve
_______________________________________________
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/6ECHTP3L756W7B5BVLAZJHFVBCQB5Y5Q/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to