Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'attribute': 0.05; 'works.': 0.07; 'python': 0.09; 'underscore': 0.09; 'received:74.125.82.44': 0.15; '*can*': 0.16; 'inheritance': 0.16; 'oct': 0.16; 'semantically': 0.16; 'wrote:': 0.17; 'tend': 0.17; 'define': 0.20; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'in.': 0.27; 'structures': 0.27; 'message-id:@mail.gmail.com': 0.27; 'class': 0.29; 'function': 0.30; 'received:74.125.82': 0.33; 'accessible': 0.33; 'avoiding': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:74.125': 0.36; 'being': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'truly': 0.62; 'more': 0.63; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=/RM/tSuj9TkMhTZtLpK9Sh/xTEhoNR+UecGYcMaJMxk=; b=Qa2Fo05CG20UDKpnQ/c4a5MbPnRC4cQOaN+RCpeCIdQEZQGVxyf5C7DQPCziD/rngW pgdNjPzuiw/+XoGDH9d/wxOzEEerCMjo7WCtK8qNca/GJRnyPM2nkVFeyqR6nUm1VKZ2 pSgFfNzHA4so692K3IXyaNLwTq/1TEK2ZXP8nqkJZLXyhhVBFc8xduN0hg10At9DNxtv sW19iYZbYVsXFAuj+9fI4wWBndsukvfsEJ0Ix+KNkJP2rUQ+UFs3E/JaqQaFMEQjEKSF NWGrgU8eEwDp2tqeUXhPkqXkDq6lWXPma4gdoEnRJU7I/cJRr6/7wZQo9/lNI2Iligs3 rCWw== MIME-Version: 1.0 In-Reply-To: <50742FD4.8030007@gmail.com> References: <1krpbz9.1wge3j11123k2vN%real-not-anti-spam-address@apple-juice.co.uk> <1krpdak.u0qy9e1a4knspN%real-not-anti-spam-address@apple-juice.co.uk> <50742FD4.8030007@gmail.com> From: Ian Kelly Date: Tue, 9 Oct 2012 11:08:13 -0600 Subject: Re: Private methods To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349802524 news.xs4all.nl 6865 [2001:888:2000:d::a6]:46639 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31050 On Tue, Oct 9, 2012 at 8:08 AM, Demian Brecht wrote: > A single underscore semantically means private. A double underscore will > name mangle the function such that it's only accessible strictly by name > through the class that it's define in. Note that you *can* still access it > if you understand how name mangling works. Nothing in Python is truly > private. I tend to view name mangling as being more for avoiding internal attribute collisions in complex inheritance structures than for designating names as private.