Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'indexing': 0.07; 'blue': 0.09; 'dict': 0.09; 'minus': 0.09; 'oh,': 0.09; 'subject:while': 0.09; 'yeah,': 0.09; "wouldn't": 0.11; 'sat,': 0.15; 'characters:': 0.16; 'folks,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literals': 0.16; 'literals.': 0.16; 'wrote:': 0.17; 'feb': 0.19; 'python?': 0.20; 'minor': 0.22; '(you': 0.23; 'this:': 0.23; 'idea': 0.24; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'wrap': 0.29; 'array': 0.29; 'no,': 0.29; 'usually': 0.30; 'fri,': 0.30; 'stuff': 0.30; 'johnson': 0.32; 'choosing': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'mapping': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'wanted': 0.36; 'characters': 0.36; "didn't": 0.36; 'two': 0.37; 'uses': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'little': 0.39; 'your': 0.60; 'stand': 0.61; 'between': 0.63; 'more': 0.63; 'car': 0.69; 'yourself': 0.77; '2013': 0.84; 'alike.': 0.84; 'dict.': 0.84; 'pike': 0.84; 'red.': 0.84; 'that)': 0.84; 'rick': 0.91; 'choice.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=uC4qJbEzpAtszaeWjvLbPEOLdkSQnJNnlw+YtHvJ9tE=; b=blJPNs/gtZkZoiBsgtUSB73h/aNVXnAOmCXb+8j5V6nJYe+1o6ClCEyR9T96IDdIHu ip92j2WZii/06DqvlbZ3kXftmJ9+/VbqZfhXdWitrLJMPakOj9+aOTCxBC+gXokR4tnB Eu7mY5ziXM4IxD6hYYNCz5fNtY810Bozlh6N/DfbkdNQp1+ENzesm3A9PHSjOfINv4SB YbNOFkY8bpL3CsaerBDS0K0h6munr58WXYMDudZp6MN07WcvPSVqY4B5ppSClkkXOF7D 3e62VX1N3ZAJSPHyMsFgWPvprMjYZNXaoGcAv0dQJK+NrMNF2WcBohxvGVlpTIUoHtWH RC6g== MIME-Version: 1.0 X-Received: by 10.220.219.77 with SMTP id ht13mr9625185vcb.66.1360386061064; Fri, 08 Feb 2013 21:01:01 -0800 (PST) In-Reply-To: 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> Date: Sat, 9 Feb 2013 16:01:00 +1100 Subject: Re: Implicit conversion to boolean in if and while statements From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360386069 news.xs4all.nl 6857 [2001:888:2000:d::a6]:43365 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38498 On Sat, Feb 9, 2013 at 12:29 PM, Ian Kelly wrote: > On Fri, Feb 8, 2013 at 5:49 PM, Rick Johnson > wrote: >> 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"})}) >> >> Folks, i couldn't make this stuff up if i wanted to. Go read for yourself if want a few laughs. > > 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. Oh, is *THAT* what he meant. I had no idea why it was so laughable. Another advantage of using two characters: There's no conflict between set and dict literals. How do you notate an empty set in Python? {} means an empty dict. In Pike, a mapping is ([]) and a multiset (you can actually have duplicates, though I don't usually make use of that) is (<>). But that's a pretty minor design decision, and I wouldn't laugh at either for the choice. It's like choosing to paint your car blue or red. ChrisA