Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Cannot step through asynchronous iterator manually Date: Sun, 31 Jan 2016 09:24:22 +1100 Lines: 44 Message-ID: References: <56AD122F.2030904@gmail.com> <56AD31E7.50407@gmail.com> <56AD36E6.5010507@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de sN80A4zLavHk8RmPNi5dlQcuVIwBvkXE3ZaQyAezE6fw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'column': 0.07; 'cc:addr:python-list': 0.09; 'foo,': 0.09; 'rows': 0.09; 'rows,': 0.09; 'semantics': 0.09; 'spec': 0.09; 'sql,': 0.09; 'underlying': 0.09; 'violates': 0.09; 'jan': 0.11; 'result.': 0.15; "(you're": 0.16; '2016': 0.16; 'async': 0.16; 'count.': 0.16; 'disallow': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'functions.)': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'row': 0.16; 'spec,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '31,': 0.22; 'am,': 0.23; 'select': 0.23; 'bit': 0.23; 'seems': 0.23; 'this:': 0.23; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'compatible': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this.': 0.28; "we're": 0.30; 'supposed': 0.31; 'entry': 0.31; "can't": 0.32; 'table': 0.32; 'maybe': 0.33; 'problem': 0.33; 'michael': 0.33; 'foo': 0.33; 'except': 0.34; 'handle': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'clear': 0.35; 'mix': 0.35; 'something': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'things': 0.38; "won't": 0.38; 'received:209': 0.38; 'several': 0.38; 'means': 0.39; 'still': 0.40; 'some': 0.40; "you'll": 0.61; 'here.': 0.62; 'engines': 0.63; 'different': 0.63; 'other.': 0.64; 'combining': 0.66; 'talking': 0.67; 'groups.': 0.72; '9:19': 0.84; 'chrisa': 0.84; 'to:none': 0.91; 'hand,': 0.97 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=6bf1o4nv83WDy3fQ5u+gf/hkPRJtfhYeTOabT1vNuzA=; b=LOuGbLAWl2N2xSn2ZeV2lsXQPYfe6HdJdARXYKc8RAJ7zv23hNFDjN6F50og27+u9R NZgaMAtqZYAGmbGZ1Jg5dxhxqMdU/l1cP2Gvr1NkV4/fy1CI8wxVCAhM9EwXfTtPiUgS V5nptsstYzKNGdj1TTlFHJbVg3ZqMQP5id9FlsoTj9ytlMdpjhqJZ/lnE1wKgP70FBkz GGpgx2jvASEOp+yo+OMLmivu6pmn+vIB1MzUZPRS6dHVg2v7tTp/B5EkApU75cwN/J7q ckZjDWh1cNHkfb++FZLVqyXf2/GxM4lSiqJGn5OGFzr2uDLSBhs/L+ASZsgjttbRGFuF Vryg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc:content-type; bh=6bf1o4nv83WDy3fQ5u+gf/hkPRJtfhYeTOabT1vNuzA=; b=nAMAUO7Fw5t8hDW6xKsLYA0eszD4DqGpa0q+9P54pDByAQv99YOLJIEoaV+vBM6tz5 11kuhL+E8MZhnMs2N+L3DIxiFTd1EQ7ZthKNPRrKK0SVR92tQmbXdXC3Fy6cxW5h63ua o9p0ekFbG9BvWk7AusEyo+LXIY+Y0SUOcuTLcoyjqfX85puaXjAjPOEunI29jspFwSYG XV/sBCOTwnJ3XjePJpmVGBjEzo0fmuzoTNOeK6+Xai+GsNewLkvDkCwmfCrliGpbk/U3 MB3jtB2bJ/qVrhQoGP7kQ8Oigv8tQxIeFzk+uNCU1m9irVnldgOmRk/OxLz6apisVrcs Eu6w== X-Gm-Message-State: AG10YORrbX1IgiaBCHRTbzxNDt/3dZe/BTEOwa8qo85YFuetz5NnGClDeDtbn/O3UGB5UnNvQtv3U8cp6yf6EA== X-Received: by 10.107.40.76 with SMTP id o73mr15242813ioo.157.1454192662426; Sat, 30 Jan 2016 14:24:22 -0800 (PST) In-Reply-To: <56AD36E6.5010507@gmail.com> 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:102321 On Sun, Jan 31, 2016 at 9:19 AM, Michael Torrie wrote: > On 01/30/2016 03:06 PM, Chris Angelico wrote: >> That actually violates the SQL spec. Some servers will accept it, >> others won't. (You're not supposed to mix column functions and >> non-column functions.) > > Are you sure? Wikipedia is not always the most accurate place, but they > have several clear examples on the SQL page of combining table fields > with count() listed. This is straight SQL we're talking about here, not > a particular implementation or dialect. Maybe there're some subtleties > at play here. Here's some info: http://stackoverflow.com/questions/5920070/why-cant-you-mix-aggregate-values-and-non-aggregate-values-in-a-single-select I don't have a good spec handy, but dig around a bit with a few different engines and you'll find that some fully-compliant engines disallow this. >> It also can't cope with 'group by' queries, as >> it'll count the underlying rows, not the groups. I also suspect it >> can't handle join queries. > > The Wikipedia entry on SQL, which seems to be based in some grounding of > the spec, shows that count(), joins, and group by are all compatible > with each other. So I dunno! Yes, they are - but not with the semantics you're looking for. If you say something like this: select count(*), foo from table group by foo then you get one row for each unique foo, with its own count. It won't tell you how many rows are in the result. >> The original approach is still the most general, and IMO the best. > > Could be. On the other hand, letting the DB do it all solves his > problem without mucking about with async iterators. Except that it means mucking about with other things :) ChrisA