I appreciate all your comments and input :-) Since I'm still new-ish to Python (only a few months, but not new to programming in general) I of course am not the best source of a strict technical design for such a feature. I am however wondering how something like this ever "advances" from a little idea to something more material and eventually a feature of the language. Do we all just sit here with our thinking caps on for awhile? đŸ˜„
On Fri, Apr 10, 2020 at 6:03 PM Eric Fahlgren <[email protected]> wrote: > On Fri, Apr 10, 2020 at 2:56 PM Serhiy Storchaka <[email protected]> > wrote: > >> Don't listen to anyone. There is only one obvious way to write this in >> one line: >> >> count = +(lambda *a: a[0](*a))((lambda q, r, s, i: r(r, q, s, i, next(i, >> s))), (lambda r, q, s, i, x: x is not s and (x in seek) + q(q, r, s, >> i)), [], iter(chars)) >> >> It is not even use such non-functional paradigm as a for loop. >> > > Awesome! My pathetic first attempt merely yielded something that no Real > Programmer would ever use. > > count = sum(a in seek for a in chars) > _______________________________________________ > 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/NILLTZEX2DZDHY7QL6XZCGYVVFOHU2D3/ > 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/C3UWA3OLPDOSVN5PIVDQ3TPFF4PGNBCB/ Code of Conduct: http://python.org/psf/codeofconduct/
