Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Torrie Newsgroups: comp.lang.python Subject: Re: Cannot step through asynchronous iterator manually Date: Sat, 30 Jan 2016 12:42:39 -0700 Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de PlZqNbjcO+WJ74TRnoI+7wJEz/lpQreqxoyMVIC9s5pw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.052 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'rows': 0.09; 'exception': 0.13; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'returned,': 0.16; 'row': 0.16; 'wrote:': 0.16; 'am,': 0.23; 'select': 0.23; 'header :In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'question': 0.27; 'raise': 0.29; 'you?': 0.30; 'message-id:@gmail.com': 0.34; 'exist': 0.35; 'something': 0.35; 'there': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'test': 0.39; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'field': 0.60; 'charset:windows-1252': 0.62; 'more': 0.63; 'times': 0.63; 'statement,': 0.66; 'frank': 0.72 X-Virus-Scanned: amavisd-new at torriefamily.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102309 On 01/30/2016 01:22 AM, Frank Millman wrote: > There are times when I want to execute a SELECT statement, and test for > three possibilities - > - if no rows are returned, the object does not exist > - if one row is returned, the object does exist > - if more that one row is returned, raise an exception Is there a reason you cannot get SQL to answer this question for you? Something like: SELECT count(some_field) WHERE condition That will always return one row, with one field that will either be 0, 1, or more than 1.