Thanks -- good to get this written down! Question: it strikes me that the use case of [] for type hints is logically quite different than for indexing. So do they need to use the same syntax / dunder?
I think that type hints are used in specific places, and thus the interpreter could know if a given [] was a type hint or an indexing operation, and thus could dispatch it differently. Would that be desirable? I'm not sure -- but as type hints' use of [] is logically quite different, it might make sense to have it use different rules. There is precedent -- after all, () used to create a tuple follows different rules than () used to call a function. If it's not technically possible to make the distinction, then it's a non-issue, but if it is, it may be worth considering. -CHB On Tue, Sep 1, 2020 at 12:40 AM Stefano Borini <stefano.bor...@gmail.com> wrote: > For those interested in the new draft of ex PEP-0472 (which has joined > the choir invisible), I opened a draft PR > > https://github.com/python/peps/pull/1579 > > This first draft contains only the revisited motivation and > background. I'll add the technical decisions etc in the upcoming > nights. > > > > -- > Kind regards, > > Stefano Borini > _______________________________________________ > 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/PMSOJNLNEHOPD3VPDDAN4NJTDK5FGKAB/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ 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/AXPADOHTLDCTHEUUJ33XESG6XT5K32P2/ Code of Conduct: http://python.org/psf/codeofconduct/