Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Sivan Greenberg Newsgroups: comp.lang.python Subject: Re: Bash-like pipes in Python Date: Thu, 17 Mar 2016 14:10:12 +0200 Lines: 33 Message-ID: References: <56e97459$0$1600$c3e8da3$5496439d@news.astraweb.com> <56ea8ded$0$1614$c3e8da3$5496439d@news.astraweb.com> <87mvpxb9zi.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de eV5FrzAJcyubpwNBDmy26QQpIY5/gWjNyNWq/xNlwPqw== 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:Python': 0.05; 'binary': 0.05; 'cto': 0.07; 'cc:addr:python-list': 0.09; 'objects.': 0.09; 'output': 0.13; 'skip:f 30': 0.15; 'thu,': 0.15; '2016': 0.16; 'cc:name:python list': 0.16; 'correctly,': 0.16; 'pipes': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'suggestion.': 0.16; 'wrote:': 0.16; 'implementing': 0.18; '>': 0.18; 'input': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; 'url:mailman': 0.30; 'skip:. 10': 0.32; 'url:python': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'subject:like': 0.33; 'url:listinfo': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'url:org': 0.36; 'received:209.85': 0.36; 'founder': 0.36; 'url:library': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; 'thank': 0.38; 'subject:-': 0.39; 'url:mail': 0.40; 'still': 0.40; '&': 0.61; 'mar': 0.65; 'here': 0.66; 'overloading': 0.84; 'pipeline': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vitakka-co.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=WmodzKnDYONrQVPDT7rMy6pT9fhFlDXRKHnmJwvQ4Ik=; b=1sJzfTKrYjNAq/o3A3/5Ds59NgzCCpyWuGI2zQMpjP6xQMunz62/5bvBALP9QsLAWA 7dxdEuc149L7u2AjdlZog+oY+OYGyQKAUHuyfoNFzTEKho+Y4mY0NyeWsDEUrtxMC2J6 lMeS2xUOm1dCMEYFG4MtLsrEOJoJk6HF5xboZdQL5MeMMgXP7vvvENiRvU/dS4GqmeoR pM1O3mDNio5VIl91U0crgUsK3O+eeyaTeMZliPn6A4QRvOavcmvPgwM0oxkw/QBDaoWp GT3MORII15OEhwRWCfT6XNBOsPCcy3EtVLq8Kx2X2lJOirhOChjd+GeD5UtW292/b31t LyXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=WmodzKnDYONrQVPDT7rMy6pT9fhFlDXRKHnmJwvQ4Ik=; b=YL3iOq6G4tq81Ohot9dvl/qWx8/fV0i13SmrzHm2QlILP/1vZ/qt9M9QEOCzDCaIR7 m+mAahmF5mwqb6Hpq5kUTm2JbsJ7TbXmQbHHOpkmiDpSjTMjclcFFEf8pr1PzE1WsR9Y LRkr/oXYy9eFBDbvKBJ0WFDd7rltXqzxSkp0Sh4TnmCP4eLPdcOzlMEbhsE2Z1u6blE+ Rquw7RQCbHjXTCq/AifKxq6z4so8wK9Ra4NDIST9y2kZ+oqxmQMINhkTdrVe0RjkxLig SJFM9g9SptlHZe4vPvd5D09bHxUSCxa1xjVnIrfEc7Z6b6LaEnNTXAaYND2CxVVgnUTL y14g== X-Gm-Message-State: AD7BkJLprPJLPnzubKT6dKIaycaGYVzzTCC8Wa/szGbuXGSWLCnXIwo0G5zNY3tq2VMvonCYRBLXho1gpr0Y0w== X-Received: by 10.129.17.142 with SMTP id 136mr3623005ywr.109.1458216613000; Thu, 17 Mar 2016 05:10:13 -0700 (PDT) X-Originating-IP: [31.154.12.26] In-Reply-To: <87mvpxb9zi.fsf@elektro.pacujo.net> X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:105089 If I understand correctly, the binary right or overloading that's seen here can be applied to any other computational objects. I could also think of implementing it for input / output pipes overloading the __ror__ method with .communicate() method of the Popen object [0]. -Sivan [0]: https://docs.python.org/2/library/subprocess.html#popen-objects On Thu, Mar 17, 2016 at 1:49 PM, Marko Rauhamaa wrote: > Steven D'Aprano : > > > On Thu, 17 Mar 2016 02:20 am, Random832 wrote: > >> fpipe("abcd12345xyz", pfilter(str.isdigit), pmap(int), preduce(mul)) > > > > Intriguing! Thank you for the suggestion. > > Still want the pipeline syntax! > > > Marko > -- > https://mail.python.org/mailman/listinfo/python-list > -- Sivan Greenberg Co founder & CTO Vitakka Consulting