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


Groups > comp.lang.python > #18238

Re: mutually exclusive arguments to a constructor

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'override': 0.07; 'python': 0.08; '#define': 0.09; 'struct': 0.09; 'there?': 0.09; 'am,': 0.12; 'c++': 0.12; 'received:209.85.210.174': 0.13; 'received :mail-iy0-f174.google.com': 0.13; 'both.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'realised': 0.16; 'roy': 0.16; 'wrote:': 0.18; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'changed': 0.23; 'interface': 0.23; 'sat,': 0.25; 'code': 0.25; '(and': 0.28; 'message- id:@mail.gmail.com': 0.28; 'class': 0.29; 'granted,': 0.30; "i've": 0.31; 'idea': 0.32; "can't": 0.32; 'to:addr:python-list': 0.34; 'probably': 0.34; 'it.': 0.34; 'all.': 0.34; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'easier': 0.38; 'why': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; '2011': 0.61; 'your': 0.61; 'stop': 0.63; '31,': 0.64; 'ever': 0.65; 'believe': 0.65; 'benefit': 0.69; 'article': 0.74; '10:39': 0.84; "life's": 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=CO/JzK3gCDsJx5+GRC7MStX0LiVgMJG1L2iv2SA260E=; b=lIIP0D2JMUJKc85weVJvZPTbKQZ4RaDEqwBqJQHOjhLaT3ssqDsgL6KOoG5FP1riYL fYvAy4BOnGvKTLQQr0hHQwHZ2Bkw0xJfOtKW5u2OgaqwWSsQMkaHDUYKjHlrMgDZVZ+H /tm8249HKaXqIpc/gpcHILCPMHR8mVO30KuuM=
MIME-Version 1.0
In-Reply-To <roy-06A099.18391630122011@news.panix.com>
References <g6k1t8xg0a.ln2@news.ducksburg.com> <roy-C73AC0.18242330122011@news.panix.com> <mailman.4256.1325288188.27778.python-list@python.org> <roy-06A099.18391630122011@news.panix.com>
Date Sat, 31 Dec 2011 10:47:20 +1100
Subject Re: mutually exclusive arguments to a constructor
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
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.4257.1325288842.27778.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325288842 news.xs4all.nl 6896 [2001:888:2000:d::a6]:39384
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18238

Show key headers only | View raw


On Sat, Dec 31, 2011 at 10:39 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.4256.1325288188.27778.python-list@python.org>,
>  Chris Angelico <rosuav@gmail.com> wrote:
>
>> You know a Python programmer's been at your C++ code when it opens:
>> #define class struct
>
> Why stop there?
>
> #define private public

Probably yeah, do both. Anyway, life's so much easier when you don't
have to write trivial getter/setter methods (and then maintain them).
I've never had a situation where I've changed a private member while
keeping the getters and setters unchanged; the ONLY benefit accessor
methods have ever given to me personally has been logging (and
granted, that is hard to do without them - since you can't override
__getitem__ in C++ - but how often do you really need that facility?).

I used to believe in the separation of interface from implementation.
Then I realised that most of the separation was transparent anyway,
and gave up on it. And then realised why the separation is a good idea
after all. :)

ChrisA

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


Thread

mutually exclusive arguments to a constructor Adam Funk <a24061@ducksburg.com> - 2011-12-30 20:40 +0000
  Re: mutually exclusive arguments to a constructor "Günther Dietrich" <gd.usenet@spamfence.net> - 2011-12-30 22:00 +0100
    Re: mutually exclusive arguments to a constructor Adam Funk <a24061@ducksburg.com> - 2011-12-31 20:55 +0000
  Re: mutually exclusive arguments to a constructor Mel Wilson <mwilson@the-wire.com> - 2011-12-30 16:08 -0500
  Re: mutually exclusive arguments to a constructor Arnaud Delobelle <arnodel@gmail.com> - 2011-12-30 21:14 +0000
  Re: mutually exclusive arguments to a constructor Jason Friedman <jason@powerpull.net> - 2011-12-30 21:18 +0000
    Re: mutually exclusive arguments to a constructor Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-30 22:21 +0000
  Re: mutually exclusive arguments to a constructor Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-12-30 22:13 +0000
  Re: mutually exclusive arguments to a constructor Roy Smith <roy@panix.com> - 2011-12-30 18:24 -0500
    Re: mutually exclusive arguments to a constructor Chris Angelico <rosuav@gmail.com> - 2011-12-31 10:36 +1100
      Re: mutually exclusive arguments to a constructor Roy Smith <roy@panix.com> - 2011-12-30 18:39 -0500
        Re: mutually exclusive arguments to a constructor Chris Angelico <rosuav@gmail.com> - 2011-12-31 10:47 +1100
    Re: mutually exclusive arguments to a constructor Adam Funk <a24061@ducksburg.com> - 2011-12-31 20:59 +0000

csiph-web