Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'correct.': 0.07; '*is*': 0.09; 'exception,': 0.09; 'python': 0.11; 'language,': 0.12; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'semantically': 0.16; 'subject: \n ': 0.16; 'subject:More': 0.16; 'syntax,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'have:': 0.19; "python's": 0.19; 'refers': 0.24; 'suggested': 0.26; 'header:In- Reply-To:1': 0.27; 'correct': 0.29; "d'aprano": 0.31; 'steven': 0.31; 'subject:other': 0.31; 'allows': 0.31; '"the': 0.34; 'case,': 0.35; 'but': 0.35; 'there': 0.35; 'object,': 0.36; 'sat': 0.36; 'charset:us-ascii': 0.36; 'sometimes': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'times': 0.62; 'design,': 0.64; 'between': 0.67; 'invalid': 0.68; 'url:jpg': 0.83; 'received:50.22': 0.84; 'subject:!)': 0.84; 'subject:via': 0.84 Date: Tue, 11 Feb 2014 09:26:46 -0600 From: Tim Chase To: python-list@python.org Subject: Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) In-Reply-To: <52f9c392$0$11128$c3e8da3@news.astraweb.com> References: <85c2698c-d681-4511-b111-bb1e549ece93@googlegroups.com> <52f9c392$0$11128$c3e8da3@news.astraweb.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com 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: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392132375 news.xs4all.nl 2943 [2001:888:2000:d::a6]:59884 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65918 On 2014-02-11 06:30, Steven D'Aprano wrote: > You need to understand the difference between syntax and semantics. > This is invalid English syntax: > > "Cat mat on sat the." > > This is valid syntax, but semantically wrong: > > "The mat sat on the cat." > > This is both syntactically and semantically correct: > > "The cat sat on the mat." And there are times you *do* want to do unconventional things with the language, and Python allows that: http://www.catster.com/files/600px-cat-hiding-under-rug.jpg because in that particular use case, it *is* semantically correct. > With Python's correct design, we have: > > spam # always, without exception, refers to the object > spam() # always, without exception, calls the object > > With your suggested design, we would have: > > spam # sometimes refers to the object, sometimes calls the object > spam() # always calls the object > > Ruby makes this mistake, and is a lessor language for it. One of the (many) reasons Ruby drives me nuts. -tkc