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: 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: References: Date: Sat, 31 Dec 2011 10:47:20 +1100 Subject: Re: mutually exclusive arguments to a constructor From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sat, Dec 31, 2011 at 10:39 AM, Roy Smith wrote: > In article , > =A0Chris Angelico 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