On Thu, Aug 27, 2020 at 10:51 AM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote:
> They're going to get one, is my reading of the "named indicies" > thread. That is, it looks to me very likely that index notation > (`x[i]`) is going to support keyword arguments (`x[i, k=v]`). If so, > that's going to be a natural way to support a `default` argument. I > imagine some people will choose it because they like it, and if there > are enough people who do there will be pressure for it to be TOOWTDI. > I support named indices. But I strongly oppose using them in list, tuple, or dict themselves. So `mylist[99, default=4]` would still be a syntax error (or maybe a different exception). I only want named indices for data structures where a clear and compelling use is demonstrated (like xarray). But allowing them syntactically allows third parties to play around in their own classes to see if they are helpful. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
_______________________________________________ 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/SKDKYXDLTTXVZQNNKJGEXRUHAEVQ7KGI/ Code of Conduct: http://python.org/psf/codeofconduct/