On Sat, 29 Aug 2020 at 05:53, Ricky Teachey <ri...@teachey.org> wrote: > > On Fri, Aug 28, 2020 at 10:10 PM Steven D'Aprano <st...@pearwood.info> wrote:
>> So let me see if I have this. You want to add a special dunder method >> which, if it exists, is automatically called by the interpreter to >> preprocess the subscript before passing it to the usual get-, set- and >> del-item dunders. > > Yes, that's the basic idea as I envision it and as Jonathan Fine wote in the > first message in this thread. > >> ... >> >> * interpreter passes arguments to the subscript dunder >> * which preprocesses them and returns them >> * and the interpreter then passes them to the appropriate dunder. >> >> I'm underwhelmed. > > I think a new dunder is a good idea. I've explained why a couple times but I > can try again if you'd like. On the other hand, we've established I'm bad at > explaining things so maybe not a great idea. I've read the discussion. I'm also not impressed by this proposal. It's not lack of understanding, so repeating your explanations isn't going to be worth it, I just don't think this is a good trade-off in terms of complexity vs benefit. There seems to be quite a lot of tendency here (not just you, others are doing it too) to assume "you didn't find my arguments convincing, so I'll explain them again and hopefully you'll understand them better". The problem isn't lack of understanding, it's just that *the arguments aren't convincing people*. Come up with new arguments, or accept that people don't agree with you. It's getting pretty hard to follow this discussion, simply because any genuinely new points are getting lost in a swamp of re-hashed explanations of arguments and suggestions that have already been made. On Sat, 29 Aug 2020 at 07:27, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote: > > On 29/08/20 4:50 pm, Ricky Teachey wrote: > > (however [Greg Ewing was] talking about > > 3 dunders-- still hoping he and others might come around to the idea of > > just one) > > Whereas I'm hoping that you might come around to the idea of > three, :-) [...] > My version is based on a vision of what the indexing dunders might > have been like if we'd had positional and keyword indexing from > the beginning. Three dunders makes sense to me, *because* it has a consistent underlying vision, we have three dunders right now, and they all handle subscripts in the same way. Any new approach to subscripting will need to be reflected either 3 times in the three dunders (your approach) or via some sort of intermediate "adapter" (Ricky's approach). Doing it cleanly seems better. Having said that, the whole thing seems like an over-complicated attempt to solve a quirk of the existing syntax that doesn't really need solving (unless there are important use cases lost in the swamp of repeated arguments I mentioned above :-(). We can simply allow for keywords to be passed to the *existing* dunders, and get enough benefit to address the key use cases, without all of this hassle. So I remain unimpressed by the bulk of the arguments here, and unconvinced that we need *any* of these proposals. Paul _______________________________________________ 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/AIVWB7PGISM4DU4Z77FAAFNKDISSKF3X/ Code of Conduct: http://python.org/psf/codeofconduct/