On Sat, Aug 22, 2020 at 11:22 AM Guido van Rossum <gu...@python.org> wrote:
> The worst that could happen would be that some user figures out they can > access the hidden functionality by writing a[key, extra=“stuff”], whereas > previously they would have to call a.__getitem__(key, extra=“stuff”). > > Doesn’t sound like a big deal, and not breakage either. > well, breakage is arguable, but I agree, not a big deal. Now that i think about it, I don't think the keywords_index object idea would break this use case either: calling the dunder directly. would stil\ work the same way. so a non-argument either way. -CHB > > On Sat, Aug 22, 2020 at 11:09 Christopher Barker <python...@gmail.com> > wrote: > >> On Thu, Aug 20, 2020 at 9:16 PM Random832 <random...@fastmail.com> wrote: >> >>> On Thu, Aug 20, 2020, at 20:09, Steven D'Aprano wrote: >>> >>> >>> > This is likely to be a rare and unusual case, but we don't want to >>> break >>> >>> >>> > anyone who already has a dunder something like this: >>> >>> >>> > >>> >>> >>> > def __getitem__(self, index, extra=None) >>> >>> >>> >>> >>> >>> People do similar things with regular arguments to regular functions >>> now, trusting callers not to pass stuff in for no reason that will break >>> the function has been adequate there. >>> >> >> Yes, but this is a little different in that the [] operator will never >> pass in anything else, but if we make this change, then it might -- so this >> is a breaking change in this case. And having keywords in the square >> brackets pass keyword args to the dunder could,m in fact break this use >> case, whereas passing a new keyword_index object would not. >> >> But as I said in an earlier note -- having ezra keyword parameters on >> __getitem__ is an abuse of the system anyway, so I think it's OK to break >> that. >> >> -CHB >> >> >> >> >>> >>> >>> _______________________________________________ >>> >>> >>> 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/XYYOGRZ673D4S7YLGGZBMB6QJ4CXNC3U/ >>> >>> >>> 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/USN6UTQ7HR4NU24V4ITP4WGFDU23MLZW/ >> >> Code of Conduct: http://python.org/psf/codeofconduct/ >> >> -- > --Guido (mobile) > -- 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/PNUWOLEEDF5F3Z23UIGCIYKO5HLNSK5Q/ Code of Conduct: http://python.org/psf/codeofconduct/