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


Groups > comp.lang.python > #111249

Re: Quick poll: gmean or geometric_mean

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ian Kelly <ian.g.kelly@gmail.com>
Newsgroups comp.lang.python
Subject Re: Quick poll: gmean or geometric_mean
Date Sun, 10 Jul 2016 09:04:32 -0600
Lines 38
Message-ID <mailman.166.1468163114.2295.python-list@python.org> (permalink)
References <57808af6$0$1602$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmpPz7MY-StGqCZnfZtNF2f6aYJGKjAjO-C9uX4ENdkCQw@mail.gmail.com> <CALwzidk=ri2Lfv+LgWe2OfuOP7a-C54VuDr-EJFJ+ATTBu9AOA@mail.gmail.com> <mailman.162.1468135773.2295.python-list@python.org> <lf5lh193orx.fsf@ling.helsinki.fi> <CALwzidmkBcK6ygpv1X6Zo4T2dXvknm2BBpz2_WHBaAmzwO5nLQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de 6/zgdlbUnJIaU0GioTW5gQOIb5/1KKktVN6OFb7OKqSA==
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.042
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'alias': 0.07; 'default.': 0.07; 'type:': 0.09; 'argument': 0.15; '2016': 0.16; 'force.': 0.16; 'longer.': 0.16; 'prefer?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'shorten': 0.16; 'such,': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'names.': 0.22; 'visible': 0.22; 'am,': 0.23; 'sat,': 0.23; 'slightly': 0.23; 'import': 0.24; 'header:In-Reply- To:1': 0.24; 'module': 0.25; "doesn't": 0.26; 'chris': 0.26; 'helpful': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'code': 0.30; "i'd": 0.31; 'anybody': 0.32; 'possibly': 0.32; 'statement': 0.32; 'though,': 0.32; "d'aprano": 0.33; 'picking': 0.33; 'shorter': 0.33; 'steven': 0.33; 'equal': 0.34; 'received:google.com': 0.35; "isn't": 0.35; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'say': 0.37; 'no,': 0.38; 'goes': 0.39; 'easily': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'still': 0.40; 'ever': 0.60; 'show': 0.62; 'skip:n 10': 0.62; 'is.': 0.63; 'choose': 0.68; 'jul': 0.72; '"very': 0.84; 'descriptive': 0.84; 'subject:Quick': 0.84; 'to:name:python': 0.84; 'subject:skip:g 10': 0.91; 'favour': 0.93; 'hands': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Qmskawe3PkFdblEBfEbYOsxWsAVFWEKcWqbTU34JMbU=; b=PqST1ACBukPIopshzBLJx+RJ2+UsNaafAX/NGXitJ5wiwQNDqZv/sqdHJq3kpRfgZ+ G0S02y+0wODr/69HsgkszhSSgxoCz4UGesXUyuh5yzi/K5vXiVofDRdEKRzOdGPVRFhO RVag/dES9oQ0zIZkoOgKOkVQWcbrE19ISdac6eLBXyifVPyrtHQPGdD4EOkTb9iibVLk 0R03AujIqgB5qTx8NphVsLdDCBdxpn6gpcMyPfU4zzZf5b15S44drbhg7sViKUsrDdB4 onG1sebGxbHW2VUZ5T+4X2qI0/okDUYjpKVo96hkkqXa6VHndrT00s7gtZdyjQrGgKTc D2JA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Qmskawe3PkFdblEBfEbYOsxWsAVFWEKcWqbTU34JMbU=; b=KShjjEtPkLzwT/XRn9aTWg0kS00kyc+3ca7FKBzDfu6lMmXXb92z8J4ghdZN8Mkbot xn/IIjuftahhyiZvXKCfSE4+4pMOZfRg15e3cCBRr0WaiudFfWemFWQU3xcQpslJLoCv C2uzw3sb3DgInNYrE+xB5ljuWKjVOVOJCRL5D3rq2rEHXYfBLuiyFYP28aNHtx3P8a79 pTvKeBicEHVLSvtwqwtbigQ2C5T73Mi7h2rS8gk2XsW4yZHy2zxg+LLV+zOBFfB9od3W b1rHcvmwY+RktZz2uUrcFTv1lB6FJXj2aScET0HG5aUxRj0vJqqxcfHkY+wH/O7rv14I KTng==
X-Gm-Message-State ALyK8tIihsNwU0cZ2TyOPSRGX4rPcLs7Cjb6XbuC8HtDZVRgp4lDsRdxYfHjWGI1bH97JRe5icpNLIoTk2JM/Q==
X-Received by 10.157.5.99 with SMTP id 90mr152346otw.190.1468163111617; Sun, 10 Jul 2016 08:05:11 -0700 (PDT)
In-Reply-To <lf5lh193orx.fsf@ling.helsinki.fi>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <CALwzidmkBcK6ygpv1X6Zo4T2dXvknm2BBpz2_WHBaAmzwO5nLQ@mail.gmail.com>
X-Mailman-Original-References <57808af6$0$1602$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmpPz7MY-StGqCZnfZtNF2f6aYJGKjAjO-C9uX4ENdkCQw@mail.gmail.com> <CALwzidk=ri2Lfv+LgWe2OfuOP7a-C54VuDr-EJFJ+ATTBu9AOA@mail.gmail.com> <mailman.162.1468135773.2295.python-list@python.org> <lf5lh193orx.fsf@ling.helsinki.fi>
Xref csiph.com comp.lang.python:111249

Show key headers only | View raw


On Sun, Jul 10, 2016 at 2:01 AM, Jussi Piitulainen
<jussi.piitulainen@helsinki.fi> wrote:
> Ian Kelly <ian.g.kelly@gmail.com> writes:
>
>> On Sat, Jul 9, 2016 at 3:45 PM, Chris Angelico <rosuav@gmail.com> wrote:
>>> On Sat, Jul 9, 2016 at 3:26 PM, Steven D'Aprano <steve@pearwood.info> wrote:
>>>> I'd like to get a quick show of hands regarding the names. Which do you
>>>> prefer?
>>>>
>>>> hmean and gmean
>>>>
>>>> harmonic_mean and geometric_mean
>>>
>>> I'd prefer the shorter names.
>>
>> I'd prefer the longer. Anybody who wants gmean can easily type:
>>
>>     from statistics import geometric_mean as gmean
>
> That argument goes both ways with equal force. Possibly very slightly in
> favour of the *shorter* names, for those who are happy to import the
> function with its eventual name as is.
>
> I did say "very slightly".

No, it doesn't. That the user can alias the name in their own code is
not an advantage at all for picking a non-descriptive name. It doesn't
change the fact that you have a non-descriptive name for the function
in the docs, the examples, and as the default. And do you really think
that anybody would ever choose an alias to make the name of a function
*longer*?

If you start out with the descriptive name though, then you get all
the benefits of such, and users who want to can easily shorten it. And
then even in code where it's been aliased to be shorter, the full
descriptive name is still visible in at least one place -- the import
statement -- which is at least somewhat helpful to anybody reading the
module who isn't familiar with the "gmean" function.

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


Thread

Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-09 15:26 +1000
  Re: Quick poll: gmean or geometric_mean Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-07-09 08:43 +0300
  Re: Quick poll: gmean or geometric_mean Random832 <random832@fastmail.com> - 2016-07-09 01:49 -0400
  Re: Quick poll: gmean or geometric_mean Ethan Furman <ethan@stoneleaf.us> - 2016-07-08 23:27 -0700
  Re: Quick poll: gmean or geometric_mean Peter Otten <__peter__@web.de> - 2016-07-09 11:04 +0200
    Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:13 -0700
      Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-13 08:17 +1000
  Re: Quick poll: gmean or geometric_mean Stefan Behnel <stefan_ml@behnel.de> - 2016-07-09 12:23 +0200
  Re: Quick poll: gmean or geometric_mean Ethan Furman <ethan@stoneleaf.us> - 2016-07-09 06:51 -0700
  Re: Quick poll: gmean or geometric_mean Jason Friedman <jsf80238@gmail.com> - 2016-07-09 08:16 -0600
  Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-09 16:13 +0000
  Re: Quick poll: gmean or geometric_mean Robert Kern <robert.kern@gmail.com> - 2016-07-09 17:53 +0100
  Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-09 18:31 +0000
  Re: Quick poll: gmean or geometric_mean Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-09 17:39 -0400
  Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-10 07:45 +1000
  Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 00:28 -0700
    Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-10 18:51 +1000
      Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-10 09:24 +0000
        Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-10 20:08 +1000
          Re: Quick poll: gmean or geometric_mean Chris Angelico <rosuav@gmail.com> - 2016-07-10 21:07 +1000
          Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 07:29 -0700
            Re: Quick poll: gmean or geometric_mean Rustom Mody <rustompmody@gmail.com> - 2016-07-10 07:44 -0700
            Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 08:55 -0600
              Re: Quick poll: gmean or geometric_mean Marko Rauhamaa <marko@pacujo.net> - 2016-07-10 18:03 +0300
                Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 11:15 -0600
                Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:17 -0700
                Re: Quick poll: gmean or geometric_mean alister <alister.ware@ntlworld.com> - 2016-07-12 22:57 +0000
                Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 18:42 -0700
                Re: Quick poll: gmean or geometric_mean Gene Heskett <gheskett@shentel.net> - 2016-07-12 21:58 -0400
                Re: Quick poll: gmean or geometric_mean alister <alister.ware@ntlworld.com> - 2016-07-13 13:03 +0000
                Re: Quick poll: gmean or geometric_mean Steven D'Aprano <steve@pearwood.info> - 2016-07-13 12:25 +1000
                Re: Quick poll: gmean or geometric_mean Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-10 19:21 -0400
            Re: Quick poll: gmean or geometric_mean Random832 <random832@fastmail.com> - 2016-07-10 12:08 -0400
            Re: Quick poll: gmean or geometric_mean Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-12 15:19 -0700
          Re: Quick poll: gmean or geometric_mean Michael Selik <michael.selik@gmail.com> - 2016-07-10 15:43 +0000
  Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 01:28 -0600
    Re: Quick poll: gmean or geometric_mean Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-07-10 11:01 +0300
      Re: Quick poll: gmean or geometric_mean Ian Kelly <ian.g.kelly@gmail.com> - 2016-07-10 09:04 -0600

csiph-web