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


Groups > comp.lang.python > #84528

Re: Delegation in Python

Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'subsequent': 0.05; 'subject:Python': 0.06; 'bug.': 0.09; 'lawrence': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'suggest': 0.14; 'changes': 0.15; '10:59': 0.16; 'debugging,': 0.16; 'fly': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nightmare': 0.16; 'undo': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'bit': 0.19; 'trying': 0.19; 'projects,': 0.19; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; 'fraction': 0.24; 'module,': 0.24; 'cc:2**0': 0.24; 'logging': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'easier': 0.31; '25,': 0.31; 'idea,': 0.31; 'class': 0.32; 'figure': 0.32; 'another': 0.32; 'projects.': 0.33; "i'd": 0.34; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'method': 0.36; 'being': 0.38; 'does': 0.39; 'bad': 0.39; 'temporarily': 0.60; 'most': 0.60; 'new': 0.61; 'simple': 0.61; 'temporary': 0.65; 'latest': 0.67; 'between': 0.67; 'score': 0.74; '2015': 0.84; 'confusing': 0.84; 'processed,': 0.84; "project's": 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=vJFGu7kzRtc2NaBpy5N+keQHbM7n2Mxqf7v0f6SFQTI=; b=RIPvRA6jFBew2UC4vgNOj6dKAQoDhsLrBbGUmV8kIvYjLgLsF/MTO6E5nmk+ZS3sMQ KGgZCiDRziUBYtt2e+Hg4TsRq3G+stNbOIuqr1EMHXe6VrXmr+9azjmK9bdmCLBLEVOc NIwvebb5qbYe2vvtRzOc1cMwDp2zEwyog2Y1ohBXqAyRGkP6K3kdHce1OFye2qF515YA TsaK0GwP13CUbbfNcsqKpEm9yjuqaVCcHJuH2xZ2lN8SvFKDYqB2lJHWea2m2BtLNx+A DH+/k8HjSd3xvwPJVgBcRR03MUfLAJfnAl2vcX8PMMauFEg/7qwaDc9r4ZwezYXlYDcw bQKg==
MIME-Version 1.0
X-Received by 10.50.62.110 with SMTP id x14mr9508209igr.2.1422144473901; Sat, 24 Jan 2015 16:07:53 -0800 (PST)
In-Reply-To <ma1ble$cn$1@ger.gmane.org>
References <FeCdnXdsTpunvlnJnZ2dnUVZ8judnZ2d@brightview.co.uk> <CAPTjJmoVxi_VXKJ93W=rPNnZiud6O_mXyxm+2tMG8BoQBqH-Ew@mail.gmail.com> <54C42D9D.7010305@digipen.edu> <ma1ble$cn$1@ger.gmane.org>
Date Sun, 25 Jan 2015 11:07:53 +1100
Subject Re: Delegation in Python
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.18115.1422144482.18130.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422144482 news.xs4all.nl 2894 [2001:888:2000:d::a6]:35560
X-Complaints-To abuse@xs4all.nl
Path csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Xref csiph.com comp.lang.python:84528

Show key headers only | View raw


On Sun, Jan 25, 2015 at 10:59 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>> You can always "monkey-path" the Fraction class on the fly to add a new
>> method to it.  I think most would consider this a bad idea, but it does
>> work.
>
> As regards this being a bad idea I'd suggest the latest score is
> Practicality 1 Purity 0 :)

Indeed. But there's a huge difference between simple and complex
projects. I had a bit of a nightmare trying to figure out what was
going on with a project's logging... it looked like the Python logging
module, but there was another argument being processed, courtesy of
some monkey-patching. Try to keep these changes to small projects,
where it's easier to keep everything in your head; or for a temporary
bit of debugging, where you just want to do this temporarily and then
undo it again when you find the bug. Otherwise, it gets confusing for
the subsequent reader.

ChrisA

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


Thread

Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-24 22:57 +0000
  Re: Delegation in Python Chris Angelico <rosuav@gmail.com> - 2015-01-25 10:22 +1100
    Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-24 23:38 +0000
      Re: Delegation in Python Chris Angelico <rosuav@gmail.com> - 2015-01-25 10:43 +1100
        Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-25 00:18 +0000
          Re: Delegation in Python Chris Angelico <rosuav@gmail.com> - 2015-01-25 11:28 +1100
            Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-25 07:49 +0000
              Re: Delegation in Python Chris Angelico <rosuav@gmail.com> - 2015-01-25 19:07 +1100
      Re: Delegation in Python Gary Herron <gherron@digipen.edu> - 2015-01-24 15:47 -0800
        Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-24 23:58 +0000
  Re: Delegation in Python Gary Herron <gherron@digipen.edu> - 2015-01-24 15:41 -0800
    Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-24 23:52 +0000
  Re: Delegation in Python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-24 23:59 +0000
  Re: Delegation in Python Chris Angelico <rosuav@gmail.com> - 2015-01-25 11:07 +1100
  Re: Delegation in Python Terry Reedy <tjreedy@udel.edu> - 2015-01-24 20:31 -0500
    Re: Delegation in Python Brian Gladman <noone@nowhere.net> - 2015-01-25 07:43 +0000

csiph-web