Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61230
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.132 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.76; '*S*': 0.02; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'targets': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'assumes': 0.31; 'context.': 0.31; 'skip:c 30': 0.32; 'skip:- 50': 0.35; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'skip:s 60': 0.36; 'list,': 0.38; 'pm,': 0.38; 'easy': 0.60; 'most': 0.60; 'smith': 0.68; 'subject:One': 0.74; 'other.': 0.75; 'to:none': 0.92; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=evCy4Hb/Qdlk/k5L4J+nemnnBSoH4NVIMVi/c/F0BOQ=; b=JxxN1l+mLDAvMejvLnvRyCgiMv9EFLrv326gEDcm9vXnygCp2Fb9oEU6OuKRIBk08I ufGtB709N/nN+pO6Rxt3h4o0YIA9VJn+gwc+0kQIRZjwYovXn4gxQ+5WomsYotyJ2s+R 8bqx81GeN11p2W3KMwSzK60F3nry7cB+yhz58NDJh9nG1OnaybYhqcMWqMP+0niNKUjX 5Tef61bOgJSFBdRdt7TvSbqlNau2XqXFrgpvgXcsaaZiqbvQu1hxjIGFUrI002jhIG9X xM55hGVm2/lZo+6UcYzDGKBxfZ2f7TnSAgk0dWseqWgxP4dRIp9rYxxD/z743fSD4a3Q ZX5Q== |
| MIME-Version | 1.0 |
| X-Received | by 10.68.32.231 with SMTP id m7mr8077673pbi.22.1386389160232; Fri, 06 Dec 2013 20:06:00 -0800 (PST) |
| In-Reply-To | <roy-10E325.22270006122013@news.panix.com> |
| References | <CAGGBd_o1TS02cosi+q9YeN5rnWJxe5mU7xtCTuTMZGO0ntF5TA@mail.gmail.com> <52A26763.3070803@gmail.com> <CAGGBd_rsP3rU6X30W_ocF8vNrPrLBrivT+nCv-1htgehmPZWrg@mail.gmail.com> <mailman.3678.1386375653.18130.python-list@python.org> <52a287cb$0$30003$c3e8da3$5496439d@news.astraweb.com> <roy-10E325.22270006122013@news.panix.com> |
| Date | Sat, 7 Dec 2013 15:06:00 +1100 |
| Subject | Re: One liners |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3697.1386389163.18130.python-list@python.org> (permalink) |
| Lines | 17 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1386389163 news.xs4all.nl 2833 [2001:888:2000:d::a6]:39696 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:61230 |
Show key headers only | View raw
On Sat, Dec 7, 2013 at 2:27 PM, Roy Smith <roy@panix.com> wrote:
> --------------------------------------------------
> extracols = sorted(set.union(*(set(t.data.keys()) for t in tracks))) if
> tracks else []
> --------------------------------------------------
> c2s = compids2songs(set(targets.keys()) |
> set.union(*map(set,targets.itervalues())),self.docmap,self.logger) if
> targets else {}
Easy rewrites:
extracols = tracks and sorted(set.union(*(set(t.data.keys()) for t in tracks)))
Assumes that tracks is a list, which it most likely is given the
context. Parallel with the other.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: One liners Michael Torrie <torriem@gmail.com> - 2013-12-06 17:20 -0700
Re: One liners Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-07 02:28 +0000
Re: One liners Chris Angelico <rosuav@gmail.com> - 2013-12-07 13:40 +1100
Re: One liners Roy Smith <roy@panix.com> - 2013-12-06 22:27 -0500
Re: One liners Chris Angelico <rosuav@gmail.com> - 2013-12-07 15:06 +1100
Re: One liners Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-07 11:27 +0000
Re: One liners Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-12-07 14:41 +0200
Re: One liners Rotwang <sg552@hotmail.co.uk> - 2013-12-07 16:13 +0000
Re: One liners Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-07 16:25 +0000
Re: One liners Rotwang <sg552@hotmail.co.uk> - 2013-12-08 02:23 +0000
Re: One liners Michael Torrie <torriem@gmail.com> - 2013-12-07 09:26 -0700
Re: One liners Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-12-07 19:49 +0200
Re: One liners Terry Reedy <tjreedy@udel.edu> - 2013-12-07 16:02 -0500
Re: One liners Michael Torrie <torriem@gmail.com> - 2013-12-07 09:56 -0700
Re: One liners rusi <rustompmody@gmail.com> - 2013-12-07 09:10 -0800
Re: One liners Michael Torrie <torriem@gmail.com> - 2013-12-07 10:02 -0700
csiph-web