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


Groups > comp.lang.python > #31104

Re: Private methods

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'attributes': 0.07; 'components.': 0.09; 'deemed': 0.09; 'logic': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tracing': 0.09; 'implemented,': 0.16; 'inheritance': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'examples': 0.18; 'together.': 0.21; 'flexibility': 0.23; "i've": 0.23; 'header :User-Agent:1': 0.26; 'url:wiki': 0.26; '(e.g.': 0.27; 'c++': 0.27; 'components': 0.27; 'header:X-Complaints-To:1': 0.28; 'though.': 0.29; 'writes:': 0.29; 'source': 0.29; 'class': 0.29; 'function': 0.30; 'code': 0.31; 'url:zope': 0.33; 'to:addr:python- list': 0.33; 'changed': 0.34; 'sometimes': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:org': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'skip:z 10': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'things': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'build': 0.39; 'header:Received:5': 0.40; 'more': 0.63; 'great': 0.64; 'become': 0.65; 'decided': 0.65; 'received:217': 0.68; 'article': 0.78; 'complex,': 0.84; 'neck.': 0.84; 'pain': 0.84; 'url:component': 0.84; 'inheritance,': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dieter Maurer <dieter@handshake.de>
Subject Re: Private methods
Date Thu, 11 Oct 2012 08:04:50 +0200
References <1krpbz9.1wge3j11123k2vN%real-not-anti-spam-address@apple-juice.co.uk> <mailman.1994.1349790529.27098.python-list@python.org> <1krpdak.u0qy9e1a4knspN%real-not-anti-spam-address@apple-juice.co.uk> <50742FD4.8030007@gmail.com> <mailman.2012.1349802524.27098.python-list@python.org> <5074b86b$0$6574$c3e8da3$5496439d@news.astraweb.com> <mailman.2016.1349828799.27098.python-list@python.org> <1krqopm.19fo57y1wri8yaN%real-not-anti-spam-address@apple-juice.co.uk> <aced18f9-785e-4bb6-a403-2203044a4ec7@p5g2000pbs.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Gmane-NNTP-Posting-Host pd9e091b4.dip0.t-ipconnect.de
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux)
Cancel-Lock sha1:DkceQlJTXRrxFh6Thn6gltAmr0U=
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 <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.2041.1349935503.27098.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1349935503 news.xs4all.nl 6963 [2001:888:2000:d::a6]:42907
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31104

Show key headers only | View raw


alex23 <wuwei23@gmail.com> writes:

> On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M.
> Procida) wrote:
>> It certainly makes it quick to build a class with the attributes I need,
>> but it does make tracing logic sometimes a pain in the neck.
>>
>> I don't know what the alternative is though.
>
> Components.
>
> The examples are in C++ and it's about game development, but I found
> this article to be very good at explaining the approach:
> http://gameprogrammingpatterns.com/component.html
>
> I've become a big fan of components & adaptation using zope.interface:
> http://wiki.zope.org/zope3/ZopeGuideComponents

If multiple inheritance is deemed complex, adaptation is even more so:

  With multiple inheritance, you can quite easily see from the source
  code how things are put together.
  Adaptation follows the "inversion of control" principle. With this
  principle, how a function is implemented, is decided outside
  and can very easily be changed (e.g. through configuration).
  This gives great flexibility but also nightmares when things do
  not work as expected...

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


Thread

Private methods real-not-anti-spam-address@apple-juice.co.uk (D.M. Procida) - 2012-10-09 14:24 +0100
  Re: Private methods Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-09 14:51 +0100
    Re: Private methods real-not-anti-spam-address@apple-juice.co.uk (D.M. Procida) - 2012-10-09 14:59 +0100
      Re: Private methods Demian Brecht <demianbrecht@gmail.com> - 2012-10-09 07:08 -0700
      Re: Private methods Robert Kern <robert.kern@gmail.com> - 2012-10-09 15:12 +0100
      Re: Private methods Tim Chase <python.list@tim.thechases.com> - 2012-10-09 09:21 -0500
      Re: Private methods Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-09 11:08 -0600
        Re: Private methods Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-09 23:51 +0000
          Re: Private methods Demian Brecht <demianbrecht@gmail.com> - 2012-10-09 17:26 -0700
            Re: Private methods real-not-anti-spam-address@apple-juice.co.uk (D.M. Procida) - 2012-10-10 08:03 +0100
              Re: Private methods alex23 <wuwei23@gmail.com> - 2012-10-10 18:34 -0700
                Re: Private methods Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-11 02:08 +0000
                Re: Private methods Dieter Maurer <dieter@handshake.de> - 2012-10-11 08:04 +0200
          Re: Private methods Robert Kern <robert.kern@gmail.com> - 2012-10-10 13:47 +0100
          Re: Private methods Ian Kelly <ian.g.kelly@gmail.com> - 2012-11-01 16:45 -0600
      Re: Private methods Roy Smith <roy@panix.com> - 2012-10-10 09:08 -0400
        Re: Private methods Ramchandra Apte <maniandram01@gmail.com> - 2012-10-10 08:56 -0700
          Re: Private methods Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-10 17:13 +0100
            Re: Private methods Grant Edwards <invalid@invalid.invalid> - 2012-10-10 16:30 +0000
            Re: Private methods alex23 <wuwei23@gmail.com> - 2012-10-10 18:39 -0700
  Re: Private methods 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-10 20:11 -0700

csiph-web