Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'bieber': 0.16; 'covers.': 0.16; 'cursor': 0.16; 'declaimed': 0.16; 'email addr:ix.netcom.com': 0.16; 'email name:wlfraed': 0.16; 'from:addr:ix.netcom.com': 0.16; 'from:addr:wlfraed': 0.16; 'from:name:dennis lee bieber': 0.16; 'received:wlfraed': 0.16; 'url:netcom': 0.16; 'url:wlfraed': 0.16; 'wulfraed': 0.16; 'url:home': 0.21; 'yeah,': 0.23; 'structure': 0.23; 'tim': 0.24; "doesn't": 0.24; "i'm": 0.27; "i've": 0.27; 'header:X-Complaints-To:1': 0.29; 'stuff': 0.29; 'sun,': 0.30; 'function': 0.30; 'worked': 0.31; 'to:addr:python-list': 0.32; 'does': 0.33; 'surprised': 0.35; 'something': 0.35; 'but': 0.36; 'charset:us-ascii': 0.37; 'object,': 0.38; 'connection': 0.38; 'object': 0.38; 'being': 0.39; 'lee': 0.39; 'received:org': 0.39; 'to:addr:python.org': 0.39; 'subject:, ': 0.60; 'believe': 0.65; 'mar': 0.69; 'dennis': 0.73; 'with,': 0.73; '2012': 0.74; '-0500,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Documentation, assignment in expression. Date: Sun, 25 Mar 2012 18:59:05 -0400 Organization: > Bestiaria Support Staff < References: <4f6d0060$0$6634$9b4e6d93@newsspool2.arcor-online.net> <4f6f0d24$0$6561$9b4e6d93@newsspool4.arcor-online.net> <4F6F1792.1060709@tim.thechases.com> <4F6F222F.7050406@tim.thechases.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-99-231.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332716353 news.xs4all.nl 6869 [2001:888:2000:d::a6]:42893 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22148 On Sun, 25 Mar 2012 08:48:31 -0500, Tim Chase declaimed the following in gmane.comp.python.general: > Yeah, it has the same structure internally, but I'm somewhat > surprised that the DB connection object doesn't have an > __iter__() that does something like this automatically under the > covers. > I believe being able to use the connection object directly for queries is considered a short-cut feature... If you use the longer form con = db.connect() cur = con.cursor() the cursor object, in all that I've worked with, does function for iteration for rec in cur: #do stuff -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/