Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Date: Sun, 06 Apr 2014 23:10:47 +0300 Organization: A noiseless patient Spider Lines: 25 Message-ID: <87txa643so.fsf@elektro.pacujo.net> References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <5334c38e$0$29994$c3e8da3$5496439d@news.astraweb.com> <53364327$0$29994$c3e8da3$5496439d@news.astraweb.com> <53365F55.2040302@gmail.com> <533836c4$0$29994$c3e8da3$5496439d@news.astraweb.com> <533e811a$0$29993$c3e8da3$5496439d@news.astraweb.com> <874n26su9f.fsf@elektro.pacujo.net> <53418644$0$29993$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="29820"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18h9cNeyi02Sd53EZLQl/Nn" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:wfgFh5GkrdMWJ1nmvzTBRpVgPOM= sha1:/KHj9/6BSCVGuurvbuXiDKL2OCM= Xref: csiph.com comp.lang.python:69780 Steven D'Aprano : > On Sun, 06 Apr 2014 12:05:16 +0300, Marko Rauhamaa wrote: >> Python, BTW, is perfectly suitable for computer science. > > I don't think it is. Python is not a pure functional language, so it's > very difficult to prove anything about the code apart from running it. Many classic CS ideas are expressed in terms of an Algol-like language. Nothing would prevent you from framing those ideas in a Python-like (pseudo)language. The question is mostly whether you prefer begin/end, braces or indentation. >> * combinatory birds in forests > > I don't believe that came from academia. If I've understood correctly, > that was from a non-academic book on applying the lambda calculus to > solve practical applications. It is academic because the author, Raymond Smullyan, was a professor of philosophy and, more importantly, my professor selected that as a textbook for us graduate students. Marko