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


Groups > comp.lang.python > #10566

Re: Function "modes" vs. separate functions

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <bahamutzero8825@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:" ': 0.03; 'cpython': 0.05; '*is*': 0.09; 'subject:Function': 0.09; 'examples': 0.12; 'wrote:': 0.15; '3.2.1': 0.16; 'explicitly.': 0.16; 'finney': 0.16; 'subject:vs.': 0.16; 'thunderbird': 0.16; 'pm,': 0.16; 'received:209.85.210.174': 0.19; 'received:mail- iy0-f174.google.com': 0.19; 'header:In-Reply-To:1': 0.22; 'code': 0.24; '(or': 0.25; '(in': 0.26; 'windows': 0.26; 'generic': 0.29; 'code,': 0.29; 'id:': 0.29; 'least': 0.31; 'message- id:@gmail.com': 0.32; 'rather': 0.33; 'implement': 0.33; 'to:addr :python-list': 0.34; 'header:User-Agent:1': 0.34; 'rule': 0.34; "can't": 0.34; 'but': 0.37; 'getting': 0.38; 'received:192': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'case,': 0.38; 'common': 0.39; 'received:192.168.1': 0.39; 'either': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'subject:. ': 0.66; 'show': 0.67; 'share': 0.68; '5.0': 0.84; 'anyway;': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=9kK9QjyHaQKRcUGLNUgGACCn31C1+J30G6yh+yNK74U=; b=xmozGBJJ5X9gE8KUfoFnTLHEs0imq0ispneAuGXRaPNNUgCDIPrJzwavMU9NByFTNd EPA3dZB0J6LZbxbPt3pvJQRpQG8R8QB0yMMfUpAlFPZVYF3MS9Jkmr9Cy5CxwzIsCoU+ G5iibTeB6C2bStowdLx2PuqiNDpSEV4VE2aQY=
Date Fri, 29 Jul 2011 21:28:26 -0500
From Andrew Berg <bahamutzero8825@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version 1.0
To "comp.lang.python" <python-list@python.org>
Subject Re: Function "modes" vs. separate functions
References <14874f59-a836-4031-a8c9-6b24f4d5e812@d7g2000vbv.googlegroups.com> <mailman.1623.1311961999.1164.python-list@python.org> <4e335535$0$29975$c3e8da3$5496439d@news.astraweb.com> <mailman.1647.1311988550.1164.python-list@python.org> <87vcukmsxd.fsf@benfinney.id.au>
In-Reply-To <87vcukmsxd.fsf@benfinney.id.au>
X-Enigmail-Version 1.2
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1649.1311992919.1164.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1311992919 news.xs4all.nl 23886 [2001:888:2000:d::a6]:44872
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10566

Show key headers only | View raw


On 2011.07.29 08:57 PM, Ben Finney wrote:
> If they share a lot of code, either it *is* separable to common
> functions (in which case, implement it that way), or the “same thing”
> code is sufficiently complex that it's better to show it explicitly.
> 
> But this is all getting rather generic and abstract. What specific
> real-world examples do you have in mind?
I can't come up with any off the top of my head. I was thinking of a
general rule anyway; ultimately one decides (or at least should) how to
write code on a case-by-case basis.

-- 
CPython 3.2.1 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB

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


Thread

PyWart: os.path needs immediate attention! rantingrick <rantingrick@gmail.com> - 2011-07-29 10:22 -0700
  Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 12:53 -0500
    Re: PyWart: os.path needs immediate attention! harrismh777 <harmar@member.fsf.org> - 2011-07-29 14:41 -0500
      Re: PyWart: os.path needs immediate attention! "Waldek M." <wm@localhost.localdomain> - 2011-07-29 21:55 +0200
    Re: PyWart: os.path needs immediate attention! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 10:50 +1000
      Function "modes" vs. separate functions (was: PyWart: os.path needs immediate attention!) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 20:15 -0500
        Re: Function "modes" vs. separate functions Ben Finney <ben+python@benfinney.id.au> - 2011-07-30 11:57 +1000
          Re: Function "modes" vs. separate functions Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 21:28 -0500
      Re: PyWart: os.path needs immediate attention! Terry Reedy <tjreedy@udel.edu> - 2011-07-30 09:48 -0400
      Re: PyWart: os.path needs immediate attention! Robert Kern <robert.kern@gmail.com> - 2011-07-30 23:31 -0400
  Re: PyWart: os.path needs immediate attention! Teemu Likonen <tlikonen@iki.fi> - 2011-07-29 23:07 +0300
    Re: PyWart: os.path needs immediate attention! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-30 10:57 +1000
      Re: PyWart: os.path needs immediate attention! Teemu Likonen <tlikonen@iki.fi> - 2011-08-01 11:19 +0300
        Re: PyWart: os.path needs immediate attention! rantingrick <rantingrick@gmail.com> - 2011-08-02 09:03 -0700
          Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-08-02 17:36 +0100
  Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-07-30 06:25 +1000
  Re: PyWart: os.path needs immediate attention! Corey Richardson <kb1pkl@aim.com> - 2011-07-29 16:44 -0400
  Re: PyWart: os.path needs immediate attention! Alister Ware <alister.ware@ntlworld.com> - 2011-07-29 21:21 +0000
    Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-29 16:36 -0500
  Re: PyWart: os.path needs immediate attention! Chris Angelico <rosuav@gmail.com> - 2011-07-30 07:43 +1000
  Re: PyWart: os.path needs immediate attention! Terry Reedy <tjreedy@udel.edu> - 2011-07-29 19:30 -0400
  Re: PyWart: os.path needs immediate attention! Michael Poeltl <michael.poeltl@univie.ac.at> - 2011-07-30 02:30 +0200
    Re: PyWart: os.path needs immediate attention! Grant Edwards <invalid@invalid.invalid> - 2011-07-30 15:33 +0000
      Re: PyWart: os.path needs immediate attention! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-30 10:56 -0500
        Re: PyWart: os.path needs immediate attention! alex23 <wuwei23@gmail.com> - 2011-08-02 23:52 -0700
  Re: PyWart: os.path needs immediate attention! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-29 22:17 -0700
  Re: PyWart: os.path needs immediate attention! Gelonida N <gelonida@gmail.com> - 2011-08-03 11:52 +0200

csiph-web