Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'python': 0.09; 'notation.': 0.09; '"="': 0.16; '-tkc': 0.16; 'covers.': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'iterator': 0.16; 'iterator.': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'yell': 0.16; 'operator': 0.16; 'cc:addr:python-list': 0.16; 'mon,': 0.16; 'wrote:': 0.20; 'header:In-Reply-To:1': 0.21; 'accidentally': 0.23; 'pascal': 0.23; 'personally,': 0.23; 'yeah,': 0.23; 'structure': 0.23; 'tim': 0.24; "doesn't": 0.24; "python's": 0.25; 'cc:no real name:2**0': 0.27; "i'm": 0.27; "i've": 0.27; 'second': 0.27; 'likes': 0.29; 'made.': 0.29; 'cc:2**0': 0.29; 'character.': 0.30; 'closer': 0.30; 'granted,': 0.30; 'omitted': 0.30; 'chris': 0.30; 'cc:addr:python.org': 0.30; 'am,': 0.31; 'moving': 0.31; 'problem': 0.31; 'header:User- Agent:1': 0.32; 'mathematical': 0.32; 'times,': 0.32; 'quite': 0.32; 'similar': 0.33; 'does': 0.33; 'it.': 0.34; 'programming,': 0.34; 'assignment': 0.35; 'surprised': 0.35; 'symbol': 0.35; 'test': 0.35; 'something': 0.35; 'pretty': 0.36; 'but': 0.36; 'issue': 0.38; 'connection': 0.38; 'object': 0.38; 'being': 0.39; 'happened': 0.39; 'using': 0.40; 'skip:e 10': 0.60; 'subject:, ': 0.60; 'your': 0.61; 'making': 0.62; 'love': 0.64; 'cause': 0.65; '26,': 0.67; 'received:50': 0.67; 'mar': 0.69; 'numerous': 0.73; '2012': 0.74; '12:03': 0.84; 'advantages.': 0.84; 'received:50.22': 0.84; 'confusion.': 0.91 Date: Sun, 25 Mar 2012 08:48:31 -0500 From: Tim Chase User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111120 Icedove/3.1.16 MIME-Version: 1.0 To: Chris Angelico Subject: Re: Documentation, assignment in expression. References: <4f6d0060$0$6634$9b4e6d93@newsspool2.arcor-online.net> <4f6f0d24$0$6561$9b4e6d93@newsspool4.arcor-online.net> <4F6F1792.1060709@tim.thechases.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Source: X-Source-Args: X-Source-Dir: Cc: python-list@python.org 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332683287 news.xs4all.nl 6963 [2001:888:2000:d::a6]:47579 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22138 On 03/25/12 08:11, Chris Angelico wrote: > On Mon, Mar 26, 2012 at 12:03 AM, Tim Chase > wrote: >> Granted, this can be turned into an iterator with a yield, making the issue >> somewhat moot: > > No, just moving the issue to the iterator. Your iterator has exactly > the same structure in it. 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. > Personally, I quite like assignment-in-conditional notation. Yes, it's > a pretty common cause of problems; but what happened to the > "consenting adults" policy? Python permits operator overloading and > even the reassignment of builtins, both of which can cause similar > confusion. In my past years of C programming, I've accidentally omitted the second "=" in a comparison test numerous times, requiring me to track down the missing character. When I finally catch it, it's obvious what the problem is, but I've come to love having Python yell at me contextually. > But, that's the choice Python's made. And being able to use the same > symbol for assignment and comparison does have its advantages. The old curmudgeon in me likes the Pascal method of using "=" for equality-testing, and ":=" for assignment which feels a little closer to mathematical use of "=". -tkc