Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '-----------': 0.04; 'indicating': 0.05; 'missed': 0.09; 'python': 0.09; 'pep': 0.09; 'sep': 0.09; 'underscore': 0.09; 'def': 0.10; 'relevant,': 0.16; 'subject:Single': 0.16; 'subject:member': 0.16; 'subject:variable': 0.16; 'syntactic': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'trying': 0.21; "i've": 0.23; 'header:In-Reply- To:1': 0.25; 'convention': 0.27; 'message-id:@mail.gmail.com': 0.27; 'skip:_ 10': 0.29; 'class': 0.29; 'could': 0.32; '11,': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; "didn't": 0.36; 'anything': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'leading': 0.61; 'times': 0.63; 'significance': 0.84; 'stuff:': 0.84; 'subject:leading': 0.84; '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=UYTyV2uoxhpTQc3WdgO2CFvRrIb8R3wuFvpbEWj7dzg=; b=cd5YpwyJtPToin1g4krz9MlQM5QadJjZOXi7hHzalHT4AQZcZlNpxQhZPbiLXTQJpG pN5l4F1cTktdkMsUg5Cr1tUl2p7gRx1hJRoT0N79wSAT3U/9f7OpyG5CuW2diMQt+IIP 7QL3aCuX+IlYKa5Plw9CpDVMV7k0W1X+vxzHcOhjJn5Ozd4lSOTELIbHH3HB14OCotlV LCJhdg+BO5XyCyShlC2UXhpO2gmhIH5FxAn/2XqyTVjMfTBH+pU/HE9s2+3h8/xrIQUo OSyr8YclN3dqbO15WTpN/TbX4+DI0vdfE5GdSdDfrCnVsAMK4g2meqPtoiMKjzfFrSuz XTPw== MIME-Version: 1.0 In-Reply-To: <2cb240e2-7992-44eb-84cf-1aba5a411ee4@googlegroups.com> References: <2cb240e2-7992-44eb-84cf-1aba5a411ee4@googlegroups.com> From: Ian Kelly Date: Tue, 11 Sep 2012 13:06:06 -0600 Subject: Re: Single leading dash in member variable names? 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347390405 news.xs4all.nl 6953 [2001:888:2000:d::a6]:35485 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28897 On Tue, Sep 11, 2012 at 12:45 PM, wrote: > All > > Python noob here. Trying to understand a particular syntax: > > class stuff: > def __init__(self): > self._bongo = "BongoWorld" > > ----------- > > What is the significance of the leading underscore in "self._bongo"? I've seen this a few times and, after looking through PEP 8, I didn't see anything relevant, but I could have missed it. Single leading underscore is a convention indicating that the name should be considered private and not used externally. It's a softer version of the double leading underscore that means basically the same thing but has syntactic significance.