Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.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.035 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.01; 'importing': 0.05; 'output': 0.05; 'random': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'subject:Code': 0.24; 'looks': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'add': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61; 'save': 0.62; 'line,': 0.68; '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:to :content-type; bh=W+wpE1uuBjVgK+PulEzpkhCiLxDJIRHjJoHh11NR2h8=; b=WWtdnZH2x8OKYLRquM9fg3UYx5C1TCUQmZEYBtTE/ekeLIu+JdxxUIpRe2iV1XbaIq 4NDauF575WhZaiLToSJy4IzlMvlT5AYRiQWSnR7jgfOKj/QAxiMTnbRnvdI1zK0DVYKO 5Al/6Jit5NH1x67n6ZyDat9GcCQrOYeUfJMGn14nlC8LkAMJRzgsz/n9BQ56cp7HAFQK yfepuap792YIfV07QPn36F98snS8q+syjbWoJmfAqgMoYKEKymomor2uZaU/1A1/Fl55 IdTLBbCeI8lD/Fw2RUKNzYfEn6aUZ867L5pdPqLEgO0KycuXGRlZaW+u2SWBYgVgokdr aNFA== MIME-Version: 1.0 X-Received: by 10.68.96.130 with SMTP id ds2mr3912188pbb.99.1381264524400; Tue, 08 Oct 2013 13:35:24 -0700 (PDT) In-Reply-To: <49d2ed27-660d-4a42-bf1d-f8117aeb002e@googlegroups.com> References: <68365e43-498f-4ad2-bac3-6a02938159c7@googlegroups.com> <49d2ed27-660d-4a42-bf1d-f8117aeb002e@googlegroups.com> Date: Wed, 9 Oct 2013 07:35:24 +1100 Subject: Re: Code golf challenge: XKCD 936 passwords From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381264533 news.xs4all.nl 15883 [2001:888:2000:d::a6]:48039 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56442 On Wed, Oct 9, 2013 at 7:27 AM, wrote: > On Tuesday, October 8, 2013 5:47:56 AM UTC-10, rand...@fastmail.us wrote: >> Importing random as r doesn't actually save anything, since " as r" is >> the same five characters you saved from the one use of it. > > I realize, it just looks nicer than the original __import__, and since it doesn't add any characters... > The optimization was using readlines. Are you aware that readlines keeps the \n at the end of each line, though? Looks a lot less clean in its output that way. That's why I used .split() in the first place. ChrisA