Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'ignored': 0.05; 'builtin': 0.07; 'indexing': 0.07; "'w',": 0.09; 'facts': 0.09; 'friday,': 0.09; 'method:': 0.09; 'minus': 0.09; 'predecessor': 0.09; 'subject:while': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.10; "'e',": 0.16; "'o',": 0.16; "'r',": 0.16; 'argument.': 0.16; 'descendant': 0.16; 'folks,': 0.16; 'happily': 0.16; 'java.': 0.16; 'literals': 0.16; 'literals.': 0.16; 'readable': 0.16; 'syntax.': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'memory': 0.18; 'feb': 0.19; 'preferred': 0.20; 'java': 0.21; 'together.': 0.21; 'sorry,': 0.22; 'cc:2**0': 0.23; 'programming': 0.23; 'work.': 0.23; 'this:': 0.23; 'cc:no real name:2**0': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'skip:[ 10': 0.26; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'wrap': 0.29; 'array': 0.29; 'no,': 0.29; 'objects': 0.29; 'fri,': 0.30; 'writes': 0.30; 'stuff': 0.30; 'johnson': 0.32; 'languages': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'sequence': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'wanted': 0.36; 'characters': 0.36; "didn't": 0.36; 'bad': 0.37; 'correctly': 0.37; 'two': 0.37; 'uses': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'little': 0.39; 'your': 0.60; 'stand': 0.61; 'first': 0.61; 'more': 0.63; 'fun': 0.64; 'making': 0.64; 'legal': 0.65; 'notices': 0.65; 'sum': 0.66; 'yourself': 0.77; 'topic,': 0.78; '2013': 0.84; 'alike.': 0.84; 'cares.': 0.84; 'pike': 0.84; 'good,': 0.91; 'rick': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ur4R0ueSn1fGyUAz6el6fiU2LuBHAaW/yQLHvXttfHM=; b=FR4hK/6zPRTQsL7TCa52ziAGmx0Mm12i6s7F5uuiG2JOj+v4RyPBtFL1mFruzxiXl/ 25+YEESsDc9TXkOr1gas+NrikH6KFLKMe6ns8vdkIgNsF1AUxwX6sgCyWgkQKQLL2aHk jxRi14v+QFTB9amGTehKXbTKkOzHe29h2afbO/sq6yzbGHMNwCJCteV3s5X+VncdavaC FnonNokfiwthK2VK8amOkuAFHnmSlPlz6SQbLn91zDxnHhzYSLMtG9dcj27XpGcxBUrY eHeuP+HmfpA5PDYDxz8JZUv2KBowgzQcr2OveOqFOvXh1vCoA4+kJuk5NA8o6ta6DKyS BpRA== X-Received: by 10.66.83.165 with SMTP id r5mr23303695pay.3.1360373393233; Fri, 08 Feb 2013 17:29:53 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <75c82449-773e-4077-a6c9-e9cef08f845f@googlegroups.com> References: <5002a1f9$0$29995$c3e8da3$5496439d@news.astraweb.com> <7b027612-a07e-40f9-8ad2-3e95c5440482@googlegroups.com> <86872ad2-fda0-403b-9f18-d1cb18e41860@t32g2000yqd.googlegroups.com> <50039290$0$29978$c3e8da3$5496439d@news.astraweb.com> <9309333c-13a0-464c-bd94-9c682363b8c9@googlegroups.com> <511516db$0$29969$c3e8da3$5496439d@news.astraweb.com> <62c3e7bb-d023-43b4-b759-f424707fd346@googlegroups.com> <75c82449-773e-4077-a6c9-e9cef08f845f@googlegroups.com> From: Ian Kelly Date: Fri, 8 Feb 2013 18:29:13 -0700 Subject: Re: Implicit conversion to boolean in if and while statements To: Rick Johnson Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360373402 news.xs4all.nl 6931 [2001:888:2000:d::a6]:35899 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38488 On Fri, Feb 8, 2013 at 5:49 PM, Rick Johnson wrote: > On Friday, February 8, 2013 6:05:54 PM UTC-6, Chris Angelico wrote: >> The sum builtin works happily on any sequence of objects >> that can be added together. It works as an excellent >> flatten() method: >> >> >>> nested_list = [["q"], ["w","e"], ["r","t","u"], ["i","o","p"]] >> >>> sum(nested_list,[]) >> ['q', 'w', 'e', 'r', 't', 'u', 'i', 'o', 'p'] >> >>> nested_list >> [['q'], ['w', 'e'], ['r', 't', 'u'], ['i', 'o', 'p']] > > What the hell? Oh yeah, you must be using pike again. No, if it were pike the list would look like this: > > ({({"q"}), ({"w","e"}), ({"r","t","u"}), ({"i","o","p"})}) > > Of course you'd have to declare it first using an /expanded/ Java syntax: > > nested_list = array(array(string)) > > Folks, i couldn't make this stuff up if i wanted to. Go read for yourself if want a few laughs. Classic ad hominem. Try to make your opponent look bad by making fun of them on a completely unrelated topic, and then hope that nobody notices that you entirely ignored the substance of their argument. Sorry, it didn't work. You didn't even do a good job of it. Yes, Pike uses two characters instead of one to wrap array literals. Big friggin' whoop. On the minus side, it's a little more typing. On the plus side, they stand out better, and you don't have the [] characters doing double duty denoting list literals and indexing alike. Yes, Pike writes **string as the more readable array(array(string)) -- although if my memory serves correctly the former is also legal syntax. Again, nobody cares. And by the by, Pike is a descendant of C, not Java. Its predecessor LPC predates Java by about 6 years. If you're going to start lambasting others' preferred programming languages in an effort to make yourself look good, you can at least get your facts straight.