Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: "Sven R. Kunze" Newsgroups: comp.lang.python Subject: Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer Date: Tue, 29 Mar 2016 18:11:36 +0200 Lines: 28 Message-ID: References: <56f9cffb$0$1614$c3e8da3$5496439d@news.astraweb.com> <56FA565A.9020800@mail.de> <56FAA22E.3040805@mail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 8kLOldCom1YNF9a2+xkUhwlpXa3K12PHEcbLb7gk6B2g== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'subject:Python': 0.05; 'expressions': 0.07; 'variant': 0.07; 'optimised': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'still,': 0.16; 'subject:Learning': 0.16; 'subject:programmer': 0.16; 'sure.': 0.16; 'wrote:': 0.16; 'subject:] ': 0.19; 'assuming': 0.22; 'progress.': 0.22; 'select': 0.23; 'bit': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'looks': 0.29; 'time;': 0.29; 'there.': 0.30; 'language.': 0.32; 'foo': 0.33; 'received:10.0': 0.34; 'best,': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'to:addr:python.org': 0.40; 'where': 0.40; 'received:de': 0.40; 'charset:windows-1252': 0.62; 'otten': 0.84; 'subject:you': 0.85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1459267897; bh=OLVveyiVdLXsWxN+EOa0RlWCCtcS0o5VFrZ7MUsm8GQ=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Tg5ZZ5DE8ZWy4AgEiiTYQ+r4q2gdFJGpl/oybihwcOihcf0oaqfj2cUdSt/VWZQqg 4s+KYzShFg0u0di/Kt14ccrYgJ2Ji4b47nXKQ3sUDMs+IqFJNaSBQ+fOBMjaDdrxUJ wWFKKjweFQ+wWgGatM5RJPz7J7U+I4EQimCZUn6E= In-Reply-To: X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 720 X-purgate-ID: 154282::1459267897-000009F3-FA616C37/0/0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105993 On 29.03.2016 18:05, Peter Otten wrote: > Reformatting it a bit > > String.Join( > "\n", > mylist.Where( > foo => !String.IsNullOrEmpty(foo.description) > ).Select( > foo => foo.description)) > > this looks like a variant of Python's > > str.join( > "\n", > map(lambda foo: foo.description, > filter(lambda foo: foo.description, mylist))) > > Assuming it's type-safe and can perhaps reshuffle the where and select part > into something optimised there is definitely progress. > > But still, Python's generator expressions are cool.. Haha, sure. But don't get stuck there. Learn something new from time to time; even a new language. Best, Sven