On Tue, 19 Oct 2021 at 00:55, Guido van Rossum <gu...@python.org> wrote: > > I should have added that I also don't feel I want to go at bat to fight for > this PEP. I do observe that it looks like the folks used to building large > systems (in Python or other languages) don't seem to like it, while it seems > to appeal to folks writing simpler code (the abundant majority of Python > users, but not of Python core devs). I worry that the experienced folks may > perhaps be a little too eager to protect newbies from shooting themselves in > the foot.
Possibly. But in *my* case, I'm not arguing from the position of a large system builder, but from that of a script writer (albeit an experienced one) and code maintainer (usually of my own code). I find y = config?.get("handler")?.get("parameters")?.get("y") unreadable and confusing, and I'd probably advise strongly against it if someone ever showed me code containing it. I see y = get_config(config, "handler", "parameters", "y") as *far* more readable and expressing the intent more directly. Yes, I find Steve's arguments persuasive, but they are not the ones I'd be concerned with when advising a newcomer. Rather I'd be saying "do you see how using a named function expresses your intent better?" and "do you see how writing a small function hides the messiness of checking for None so that your main code is cleaner?" *Shrug* I guess I just don't understand how people can look at a string of ?.get() and see it as readable and obvious :-( Paul _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/QOWSJXN3WE7WLUYB22HZNOZJ6GGGRWVF/ Code of Conduct: http://python.org/psf/codeofconduct/