Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'backwards': 0.07; 'decent': 0.07; 'ignored': 0.07; 'python': 0.08; '21,': 0.09; 'myself,': 0.09; 'skip:[ 30': 0.09; 'subject:method': 0.09; 'output': 0.10; '"))': 0.16; 'subject:function': 0.16; 'subject:python.': 0.16; 'subject:release': 0.16; "wouldn't": 0.17; 'wed,': 0.17; 'wrote:': 0.18; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'figure': 0.23; 'code': 0.25; 'code.': 0.26; 'fact': 0.27; 'message- id:@mail.gmail.com': 0.28; 'pm,': 0.29; 'eat': 0.30; 'grasp': 0.30; 'received:209.85.210.46': 0.30; 'received:mail- pz0-f46.google.com': 0.30; 'subject:support': 0.30; "i've": 0.31; 'version': 0.32; 'components': 0.32; 'programmers': 0.32; 'done': 0.34; 'to:addr:python-list': 0.34; 'community': 0.34; 'identical': 0.34; 'basics': 0.37; 'to:name:python-list': 0.37; 'two': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'first.': 0.39; 'either': 0.39; 'should': 0.39; 'subject: (': 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; 'your': 0.61; 'natural': 0.66; 'money': 0.75; '12:53': 0.84; 'nathan': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=zQI7u0pvP26gj74QDdSFNRpT6L3VXg0EaJVEtM3Xl1E=; b=foNSAtlQGionAniHn3c5v7LbUwgexvON7xsDSI/wFvPUe6WXWWcK1fy0iVRBU2vLQo pzoMtihy3ZRKXyZ/oUZdrAX7Q0ATD65u7jMw79NjXKEXadNtfYhpyo71Qp8topqBixzs p2d0YiQdtSXMP+DAIE2og4QKKhp29kBEHIyho= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 21 Dec 2011 13:16:28 -0500 Subject: Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. From: Nathan Rice To: python-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324491392 news.xs4all.nl 6863 [2001:888:2000:d::a6]:44182 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17686 On Wed, Dec 21, 2011 at 12:53 PM, Arnaud Delobelle wrot= e: > > You can already do: > > efoo2 =3D ["one", "two", "three", "four"] > ["_".join(reversed((x.capitalize() + " little indian").split(" ")) * 2) > =A0 =A0 for x in efoo2] > > Note 1: I've ignored the fact that reversed(...)*2 is erroneous > Note 2: I wouldn't such code myself, in either form > > What's the advantage of your elementwise stuff? Sit two theoretically identical programmers who have a decent grasp of python, understand the basics of ElementwiseProxy and the components of your version down side by side, and see which one can figure out what the output should be first. I will bet real money it is the one working with the ElementwiseProxy code. We have all had a lot of practice reading inside out and backwards in the python community with comprehensions and such, but it is in no way natural or easy. Additionally, everything done via an ElementwiseProxy is lazy, so you only pay for what you eat :) Nathan