Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subsequent': 0.04; '21,': 0.07; 'versions.': 0.07; 'python': 0.09; 'subject:method': 0.09; 'underscore': 0.09; 'programmer': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reasonably': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'exists': 0.17; 'jan': 0.18; 'variable': 0.20; 'people,': 0.21; 'recognize': 0.22; "python's": 0.23; 'header:In-Reply-To:1': 0.25; 'possibly': 0.27; 'c++': 0.27; 'convention': 0.27; 'message-id:@mail.gmail.com': 0.27; 'smart': 0.29; 'expect': 0.31; 'conventions': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'should': 0.36; 'quite': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'think': 0.40; 'leading': 0.61; 'real': 0.61; 'skip:n 10': 0.63; '2013': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=2i8GA5Mep8mpKzeJJDBlcsrBbMnlHO2/Af96P5hDs0A=; b=hqXklGYS5WmTuA33msKhef4dVTxcWMxEUqA6Q+R5FXNkTVSHA7knR0gbe/QSZH4EW8 /C1DJfEgEKNHAqu8KdVs2PDTJiKgb+3QFU3fXcbuL/ezZilEZaeBAgptPHlZyiQtiCPl H1LEHezUrfdW0SteIha0EUkWqf2a+9T4jFmRLMCW7D+TwIEnrEVZVK3NHno6p+72XR6D IUW9iXbOeLSOUddNlHhGoCmwpYX4WpKIn5NfmQ5p9n+QZ9e1Ui8tuQlf8m6lMhD+fARa Avqn1xAjGcGDIM5owjmkm4mOWnmcr132SZw8ZL8AAB/PgsYGRY23IcUL/Jh9WAZjgKtn rSaA== MIME-Version: 1.0 X-Received: by 10.220.156.10 with SMTP id u10mr17742474vcw.28.1358731578580; Sun, 20 Jan 2013 17:26:18 -0800 (PST) In-Reply-To: References: Date: Mon, 21 Jan 2013 12:26:18 +1100 Subject: Re: To make a method or attribute private From: Chris Angelico To: python-list@python.org 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358731586 news.xs4all.nl 6881 [2001:888:2000:d::a6]:60694 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37133 On Mon, Jan 21, 2013 at 12:14 PM, iMath wrote: > so there is no REAL private variable in Python but conversion exists in it that python programmer should follow and recognize .right ? That's about it. If you think about C++ public members as the "interface" and private/protected members as the "implementation", then Python's convention is a leading underscore on the latter; you can reasonably expect that non-underscore members can be trusted to be maintained, but underscored members will quite possibly change in subsequent versions. Among smart people, conventions like this are all you need. ChrisA