Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'underscore': 0.09; 'a(object):': 0.16; 'do)': 0.16; 'received:80.91.229.3': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-dialin.net': 0.16; 'subject:interfaces': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'occurs': 0.22; 'pass': 0.25; 'header :User-Agent:1': 0.26; 'right.': 0.27; '(as': 0.27; 'restrict': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'noticed': 0.28; 'starts': 0.29; 'class': 0.29; "skip:' 10": 0.30; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'but': 0.36; 'method': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'end': 0.40; 'skip:n 10': 0.63; 'making': 0.64; 'life': 0.66; 'sounds': 0.71; 'subject:Nice': 0.84; 'edwards': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: Nice solution wanted: Hide internal interfaces Date: Mon, 29 Oct 2012 18:17:56 +0100 Organization: None References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p50849008.dip.t-dialin.net User-Agent: KNode/4.7.3 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351531083 news.xs4all.nl 6913 [2001:888:2000:d::a6]:37847 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32407 Johannes Bauer wrote: > On 29.10.2012 17:52, Grant Edwards wrote: > >> By "decleare them privide" do you mean using __ASDF__ name-munging? >> >> It sounds to me like you're just making life hard on yourself. > > Gaaaaaah, you are right. I just noticed that using the single underscore > (as I do) does not restrict usage in any "non-natural" way. I was > actually mixing this up in my head with the __xyz__ name-munging. Name-munging occurs only if the method name starts but doesn't end with "__": >>> class A(object): pass ... >>> class B(A): ... __before = __between__ = __ = 42 ... >>> set(dir(B)) - set(dir(A)) set(['__', '_B__before', '__between__'])