Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.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.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'python,': 0.02; 'syntax': 0.04; 'one?': 0.05; 'none,': 0.07; 'referring': 0.07; 'arguments,': 0.09; 'consistency': 0.09; 'parameter': 0.09; 'appear.': 0.16; 'clear.': 0.16; 'consistency.': 0.16; 'opposite': 0.16; 'otoh,': 0.16; 'ought': 0.16; 'parentheses': 0.16; 'should.': 0.16; 'subject:More': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'why.': 0.24; 'header:In-Reply-To:1': 0.27; 'generally': 0.29; 'points': 0.29; 'important.': 0.30; 'to?': 0.30; '(which': 0.31; 'code': 0.31; 'that.': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'subject:other': 0.31; 'you\x92re': 0.31; 'lists': 0.32; 'maybe': 0.34; 'could': 0.34; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'functions.': 0.36; 'opposed': 0.36; 'should': 0.36; 'example,': 0.37; 'message- id:@gmail.com': 0.38; 'desirable': 0.38; 'others.': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'heard': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'easy': 0.60; 'course': 0.61; 'header:Message-Id:1': 0.63; 'him,': 0.64; 'provide': 0.64; 'more': 0.64; 'different': 0.65; 'love': 0.65; 'charset:windows-1252': 0.65; 'between': 0.67; 'past,': 0.68; 'fact,': 0.69; '2014,': 0.84; 'bite': 0.84; 'it\x92s': 0.84; 'i\x92d': 0.84; 'i\x92ve': 0.84; 'loose': 0.84; 'subject:!)': 0.84; 'subject:via': 0.84; 'habit': 0.91; 'mistake': 0.91; 'you).': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Oiwb5zRkNmRO4925AOsK03DlR6kUpeVKVcnbvFHHJe4=; b=gJM20Shxl1Ta2EZt7tYU0RXzDXMOanz94DKVbS+bsQYSz/YGDdZN5Z4hAFOUUuEyxL XOcs6em1z1EvbzCGc9BzjIEGR3YVOs0HZku6KmovQOfOJZWgQBbOK2uIJnbnjkpKJEqD Y5iytBrjsIjVF7tidXvYtKvh606rTiNMuVkWqlXrKKaJadJE8GW8Ya/MJ3XGNhKgnlGD ZdcQGglv1YgK4tI3fVWTkBFo01pOAsmYPhhFvVT6KCm6psg9+2vJfJEQwoqleHPfaJm2 xgINuJse7lxp1FguWs3ZwW5xiBxlTevL5C4G9HcrE5CdPwTyD5VgSV4T9DTbyRQC2m77 yZuA== X-Received: by 10.68.240.36 with SMTP id vx4mr45451252pbc.140.1392132998352; Tue, 11 Feb 2014 07:36:38 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) From: Travis Griggs In-Reply-To: <52f9c392$0$11128$c3e8da3@news.astraweb.com> Date: Tue, 11 Feb 2014 07:36:34 -0800 Content-Transfer-Encoding: quoted-printable References: <85c2698c-d681-4511-b111-bb1e549ece93@googlegroups.com> <52f9c392$0$11128$c3e8da3@news.astraweb.com> To: python-list@python.org X-Mailer: Apple Mail (2.1827) 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: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392133008 news.xs4all.nl 2914 [2001:888:2000:d::a6]:37988 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65919 On Feb 10, 2014, at 10:30 PM, Steven D'Aprano = wrote: >>=20 >> 1. Parenthesis should not be required for parameter- less = functions. >=20 > Of course they should. Firstly, parameter-less functions are a code- > smell, and ought to be discouraged. Secondly, even if you have a good=20= > reason for using one -- for example, random.random -- then the = difference=20 > between referring to the object and calling the object should be = clear. Interesting. Can you clarify or provide some links to the = "parameter-less functions are a code-smell=94 bit? I agree with your points about consistency. I disagree with the original = poster that niladic functions should have a different syntax than the = others. I empathize with him, I=92ve made the same mistake before (being = an ardent Smalltalker in the past, it=92s an easy habit to have bite = you). But the consistency is more important. And in python, things = =93happen=94 when parentheses appear. I just accept that. OTOH, I=92m not sure I=92ve heard the parameters-less functions are a = code one? Is it just loose functions that you=92re referring to? As = opposed to methods (which are just bound functions)? I could maybe = accept that. But methods with fewer arguments, and even none, are a = desirable thing. There are code smells that are the opposite in fact, = methods with long parameter lists are generally seen as code smell = (=93passing a paragraph=94). Anyway, I=92d love to understand better what you see as the code smell = and why.=