Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65919

Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!)

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 <travisgriggs@gmail.com>
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 <travisgriggs@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6677.1392133008.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Feb 10, 2014, at 10:30 PM, Steven D'Aprano <steve@pearwood.info> wrote:

>> 
>>    1. Parenthesis should not be required for parameter- less functions.
> 
> Of course they should. Firstly, parameter-less functions are a code-
> smell, and ought to be discouraged. Secondly, even if you have a good 
> reason for using one -- for example, random.random -- then the difference 
> 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” 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’ve made the same mistake before (being an ardent Smalltalker in the past, it’s an easy habit to have bite you). But the consistency is more important. And in python, things “happen” when parentheses appear. I just accept that.

OTOH, I’m not sure I’ve heard the parameters-less functions are a code one? Is it just loose functions that you’re 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 (“passing a paragraph”).

Anyway, I’d love to understand better what you see as the code smell and why.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Rick Johnson <rantingrickjohnson@gmail.com> - 2014-02-10 10:45 -0800
  Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-10 19:15 +0000
  Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Ned Batchelder <ned@nedbatchelder.com> - 2014-02-10 14:17 -0500
  Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Rotwang <sg552@hotmail.co.uk> - 2014-02-10 21:12 +0000
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Ned Batchelder <ned@nedbatchelder.com> - 2014-02-10 17:00 -0500
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Terry Reedy <tjreedy@udel.edu> - 2014-02-10 17:59 -0500
  Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Chris Angelico <rosuav@gmail.com> - 2014-02-11 09:30 +1100
  Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Steven D'Aprano <steve@pearwood.info> - 2014-02-11 06:30 +0000
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Tim Chase <python.list@tim.thechases.com> - 2014-02-11 09:26 -0600
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Travis Griggs <travisgriggs@gmail.com> - 2014-02-11 07:36 -0800
      Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-02-11 18:07 +0200
        Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Chris Angelico <rosuav@gmail.com> - 2014-02-12 03:14 +1100
      Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Steven D'Aprano <steve@pearwood.info> - 2014-02-13 04:11 +0000
        Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Chris Angelico <rosuav@gmail.com> - 2014-02-13 15:30 +1100
          Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Roy Smith <roy@panix.com> - 2014-02-13 09:58 -0500
            Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Chris Angelico <rosuav@gmail.com> - 2014-02-14 06:17 +1100
        Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Tim Chase <python.list@tim.thechases.com> - 2014-02-13 05:39 -0600
        Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Tim Chase <python.list@tim.thechases.com> - 2014-02-13 05:51 -0600
        Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-13 15:00 -0700
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Chris Angelico <rosuav@gmail.com> - 2014-02-12 02:52 +1100
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Travis Griggs <travisgriggs@gmail.com> - 2014-02-11 08:19 -0800
    Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!) Terry Reedy <tjreedy@udel.edu> - 2014-02-11 12:57 -0500

csiph-web