Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'encouraging': 0.07; 'rows': 0.09; 'sep': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterating': 0.16; 'length,': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'code,': 0.18; 'received:209.85.214.174': 0.21; 'subject:Questions': 0.22; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'separate': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'query': 0.30; "he's": 0.33; 'scroll': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'table': 0.35; 'received:209.85': 0.35; 'really': 0.36; 'bad': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'subject:Interview': 0.84; 'inefficient': 0.91 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=OWoraQJxBXg5jTWTFIwnfuupS5VRcF6YResyyVGWj7s=; b=M59OiXnPu/yEDf7IOM8d+j1QBl9+9AwO9/twAvWlWNDsPpK8hCOGSHha7mCi8H5qbK roH+wEHh9Y6DZJjcqRllGmZWMqobbNbtqnqnUReELVHEbLGrnGiH/ECNYKKSDFiOt7rH VSXgN4bKqnO6WHlwV4Ixu/C1cmnmXWptgfSBSI0XG5sy6b9r6eLKM56tCfSuERGkdjud IWVMiL8Nl/62MZb2PCMwsAd95ysaldKg/9PmE9Hi7TGK99x8iM/hNZCnvujY7qmB1nc7 a0gGC3pNP26fry5li8M5349i78LkRVmwbHOz9ahMcXRX6NR0jWFBTceMMn/+ws51AP2N 8Tpw== MIME-Version: 1.0 In-Reply-To: References: <1193768041.349129.26350@v3g2000hsg.googlegroups.com> Date: Thu, 6 Sep 2012 00:36:50 +1000 Subject: Re: Python Interview Questions 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346855813 news.xs4all.nl 6894 [2001:888:2000:d::a6]:58712 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28503 On Thu, Sep 6, 2012 at 12:34 AM, Chris Angelico wrote: > However, this strikes me as encouraging some really > inefficient code, like iterating over all the rows in a table with N+1 > queries (one to get the length, then a separate query for each row). Huh. And then I scroll down, and that's precisely what he's doing. Do you understand why this is a bad thing to do? ChrisA