Comprehension are very much based on the idea of *declarative* data collections. That's their entire reason for being. In general, one expects comprehension to be side-effect free and just build a collection according to declared rules. Obviously I know many ways to smuggle in side effects, but doing so goes against their spirit and user expectations.
A comprehension should read as one line. At very least logically, but usually physically. If I ever find myself wiring a comprehension longer than about 120 characters, I know it's time to refactor into a function and block loops. I've cleaned up far too much code that used too-complex nested comprehension. Everything about this proposal is antithetical to the intention of comprehension. On Sat, Feb 22, 2020, 2:27 AM Alex Hall <[email protected]> wrote: > > The weird block structures inside comprehension reads terribly even in > the trivial case shown > > David, it's fine if you have that opinion, but you're replying > specifically to my post where I asked someone to elaborate on that kind of > opinion, so it bothers me that you just restated it without explanation. > I'm curious, in what way does it read terribly? Why are the block > structures "weird"? > _______________________________________________ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/BG426WY2XQQVQVXZK6HYROBXATQ6VVR3/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/KXFODWD7QN3G5XPSQ6DNSNOBWVYYE2VL/ Code of Conduct: http://python.org/psf/codeofconduct/
