On 31/08/20 3:37 am, Guido van Rossum wrote:
I recall a law from evolutionary biology that went something like “once a feature is gone it won’t evolve a second time (in the same species)”. I have no interest in restoring argument unpacking.
That can't be an absolute law. If a species loses a feature, it's because the environment has changed so as to make it no longer advantageous. If there is another environmental change that makes it advantageous again, I can't see why it couldn't come back. Maybe not exactly the same, but something very similar. Here we have a situation where the environment has changed. I'd like to propose bringing back something that is superficially similar, but with some differences. def __getitem__(self, (i, j, k)): The differences are: 1. There can only be one set of parens, and they must enclose all except the first positional argument. 2. Arguments within the parens can be specified by keyword. Difference 2 is what makes this more than just syntactic sugar for taking one argument and unpacking it later, which was the reason for eliminating argument unpacking originally. If you're worried about people abusing this for purposes other than the one intended, another restriction could be added: 3. (Optional) It can only be used in functions named __getitem__, __setitem__ or __delitem__. -- Greg _______________________________________________ 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/T2OHMNPKDPGREJJF45Q66MM4EKTBF27U/ Code of Conduct: http://python.org/psf/codeofconduct/