Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'test,': 0.05; 'mess': 0.09; 'splitting': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'subject:python': 0.11; 'cleanly': 0.16; 'conditional': 0.16; 'readable': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'passes': 0.17; 'tend': 0.17; 'memory': 0.18; 'code.': 0.20; 'cc:2**0': 0.23; 'insert': 0.23; 'cc:no real name:2**0': 0.24; 'specifically': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'handling': 0.27; 'dan': 0.29; 'statements': 0.29; "i'm": 0.29; 'becomes': 0.30; 'error': 0.30; 'skip:- 10': 0.32; 'print': 0.32; 'anyone': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'from:addr:googlemail.com': 0.35; 'doing': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'method': 0.36; 'should': 0.36; 'item': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'perform': 0.38; 'object': 0.38; 'some': 0.38; 'think': 0.40; 'skip:u 10': 0.60; 'dead': 0.62; 'jul': 0.65; 'tasks.': 0.65; 'death': 0.71; 'dennis': 0.91 Newsgroups: comp.lang.python Date: Tue, 31 Jul 2012 12:01:38 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=123.192.83.145; posting-account=5JdMBQoAAABHnS4mjpqEzxnmWtgiiVNw References: <1343631941.7199.YahooMailNeo@web193104.mail.sg3.yahoo.com> <1826E39D-43C1-4CEB-AEA2-133B95AC0B0B@barrys-emacs.org> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 123.192.83.145 MIME-Version: 1.0 Subject: Re: Linux shell to python From: 88888 Dihedral To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 82 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343761303 news.xs4all.nl 6876 [2001:888:2000:d::a6]:53713 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26325 Mark Lawrence=E6=96=BC 2012=E5=B9=B47=E6=9C=8831=E6=97=A5=E6=98=9F=E6=9C=9F= =E4=BA=8CUTC+8=E4=B8=8B=E5=8D=883=E6=99=8215=E5=88=8632=E7=A7=92=E5=AF=AB= =E9=81=93=EF=BC=9A > On 31/07/2012 02:20, Dennis Lee Bieber wrote: >=20 > > On Mon, 30 Jul 2012 22:56:48 +0000, Dan Stromberg >=20 > > declaimed the following in gmane.comp.python.general: >=20 > > >=20 > > >=20 > >> Sigh, and I'm also not keen on multi-line list comprehensions, specifi= cally >=20 > >> because I think they tend to make less readable code. It also becomes= a >=20 > >> mess when you need to insert print statements to get some visibility i= nto >=20 > >> what's going on. >=20 > > >=20 > > Cleanly splitting the list-comp by >=20 > > >=20 > > [ result-computation >=20 > > for-item-selection-clause >=20 > > if-filter-clause ] >=20 > > >=20 > > isn't that unreadable... But anyone doing >=20 > > >=20 > > [ result- >=20 > > -computation for-item- >=20 > > -selection-clause if- >=20 > > -filter- >=20 > > -clause ] >=20 > > >=20 > > should be pecked to death by a dead parrot. >=20 > > >=20 >=20 >=20 > Any particular species? >=20 >=20 >=20 > --=20 >=20 > Cheers. >=20 >=20 >=20 > Mark Lawrence. For each item in the known list that passes the required conditional test, then use the item to perform the tasks desired as instructed. It is not necessary that a new list has to be constructed in the tasks. A method which can produce a new object always involves some memory managem= ent.=20 Therefore, some error handling part should not be missing.