Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:two': 0.07; 'lawrence': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'measured': 0.16; 'subject:based': 0.16; 'subject:key': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'feb': 0.22; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'lines': 0.31; 'subject:per': 0.31; 'subject:from': 0.34; 'subject:lists': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'right?': 0.36; 'should': 0.36; 'pm,': 0.38; 'blank': 0.60; 'is.': 0.60; 'course': 0.61; 'line,': 0.68; '2015': 0.84; 'minute.': 0.91; 'to:none': 0.92 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=Y+EHqh+ye6P6tnUrxH5ZbKRBE3LTmc+RwtemJ5tbQgc=; b=0ar3uS9OWj/8n9Mt+MY9Ir8mLgSmZ7+n1/0Zg45si+8K9dlLQYvR6/22uraNr/yArh apnyBa7cziZKSqgq2Dy0hoQ2XwMYz4OJcmppNXm1iyz0S5qZ4E/m32i67KctWEHpSLk1 Ql+HCdH8Myu0iOROhmtGNt8Y4QXZO0y9BgnG3VRsuATVWrZEG5Li5j49h6I4n87OYlHY RF2NwaA7Ajb1Zg++KKLKLpoAWiwTSBZru9ydU1QTC6+RP0+jMJK01S9+OvuVqCa3P9oe IKD2V7Cd1u422VIbMJs1QyCjp7jVZfv1Z9SWSkL0OEl8cYG1oZVmKIRbCrWlKo9qPYxa fh6A== MIME-Version: 1.0 X-Received: by 10.107.167.201 with SMTP id q192mr15990032ioe.43.1422760936504; Sat, 31 Jan 2015 19:22:16 -0800 (PST) In-Reply-To: References: <0dddee06-233b-436a-be48-3c16e62c1718@googlegroups.com> Date: Sun, 1 Feb 2015 14:22:16 +1100 Subject: Re: Create dictionary based of x items per key from two lists From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422760944 news.xs4all.nl 2903 [2001:888:2000:d::a6]:46383 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84977 On Sun, Feb 1, 2015 at 2:06 PM, Mark Lawrence wrote: > The one-liner might not be better code, but it must be better speed wise > precisely because it's on one line, right? :) Well of course it is. Python code speed is always measured in lines per minute. That's why you should eliminate blank lines from your code. ChrisA