Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed3.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.03; 'literal': 0.09; 'notation.': 0.09; 'received:mail-vc0-f174.google.com': 0.09; 'subject:while': 0.09; '"set': 0.16; '(when': 0.16; 'argument.': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literal.': 0.16; 'wording': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'exists': 0.17; 'feb': 0.19; 'issue.': 0.20; 'bit': 0.21; 'sets': 0.23; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'all.': 0.28; "d'aprano": 0.29; 'received:209.85.220.174': 0.29; 'steven': 0.29; "i'm": 0.29; 'johnson': 0.32; 'could': 0.32; '11,': 0.33; 'symbol': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'described': 0.35; 'lists.': 0.35; 'doing': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'should': 0.36; 'too': 0.36; 'available.': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'stand': 0.61; 'due': 0.66; 'soon': 0.70; 'unusual': 0.71; '2013': 0.84; 'pike': 0.84; 'reasoning': 0.91; 'rick': 0.91 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=T1JyILL+juKOibwpH86EHQ7f8gw4ym8uUbq1YhEMY3M=; b=gxLz3ZhQ/45DJdYIu03eyCRdwf09QYoGsLQAyiqXzqAeidYpmfPTpnT/HdhzFJnC3p 4fPVpJ6ztJk+ySPlAgZLel1be6VgGFARZjmUyBstEz3lrAaGRVC8Rhh7d+7NUythi3wO wtNdU2yBKhnHZqas13YPgzRUioTPI5iYVLmKrdIfbWqBD9SP/p+Quo6JUv9MUWB6M+Pk 8dqVmf4OtGzCYXWElfQ1NwOIrtOauQRvV1LcqR/wSTrRaHCDaOIRvNoSkqkKwojBeg6M UrVy0KsKYN33YTEJghbUhSqsJvK1xriUdYcPqQHiAcn5O2QFY8pbdzHyuH/v4LEdec2Q BI+g== MIME-Version: 1.0 X-Received: by 10.52.37.109 with SMTP id x13mr16311887vdj.10.1360586423282; Mon, 11 Feb 2013 04:40:23 -0800 (PST) In-Reply-To: <375e9978-54a2-421a-a1fa-7f39cafc4f31@googlegroups.com> References: <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> <13e5e306-d253-418e-a1b2-ac5bde03f07d@googlegroups.com> <5117868b$0$29998$c3e8da3$5496439d@news.astraweb.com> <375e9978-54a2-421a-a1fa-7f39cafc4f31@googlegroups.com> Date: Mon, 11 Feb 2013 23:40:23 +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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360586431 news.xs4all.nl 6873 [2001:888:2000:d::a6]:39817 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38671 On Mon, Feb 11, 2013 at 11:18 PM, Rick Johnson wrote: > On Sunday, February 10, 2013 5:37:46 AM UTC-6, Steven D'Aprano wrote: >> Rick Johnson wrote: >> > IMO "Set Types" should only exists as a concequence of "freezing" an >> > array, >> >> Sets are not frozen lists. > > Indeed. That wording was a bit clumsy on my part. > >> > and should have NO literal syntax available. > > I may have spoken too soon on this issue. My reasoning for /not/ having a literal set syntax was due to symbol congestion, however as i described in another post, the problem can be solved by literally "type declaring" the literal. Or doing what you were pointing and laughing at Pike for, and using two-symbol delimiters. You could even make it majorly logical: list_ = [[ 1, 2, 3 ]] tuple_ = ([ 1, 2, 3 ]) dict_ = [{ 1, 2, 3 }] frozendict_ = ({ 1, 2, 3 }) set_ = [< 1, 2, 3 >] frozenset_ = (< 1, 2, 3 >) I'm not actually sure where I stand on that argument. Some of those types are distinctly unusual (when would you use frozendict?), and may well not need literal notation. But it is nice to have them all. ChrisA