Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28901

Re: Single leading dash in member variable names?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <e.doxtator@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '-----------': 0.04; 'indicating': 0.05; 'missed': 0.09; 'python': 0.09; 'pep': 0.09; 'sep': 0.09; 'to:addr:comp.lang.python': 0.09; 'underscore': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; 'relevant,': 0.16; 'subject:Single': 0.16; 'subject:member': 0.16; 'subject:variable': 0.16; 'syntactic': 0.16; 'think?': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'trying': 0.21; 'cc:2**0': 0.23; "i've": 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'convention': 0.27; 'skip:_ 10': 0.29; 'class': 0.29; 'could': 0.32; 'says': 0.33; '11,': 0.33; 'form.': 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; 'thank': 0.36; 'bad': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:" 10': 0.40; 'from:no real name:2**0': 0.60; 'leading': 0.61; 'times': 0.63; 'significance': 0.84; 'stuff:': 0.84; 'subject:leading': 0.84
Newsgroups comp.lang.python
Date Tue, 11 Sep 2012 13:53:26 -0700 (PDT)
In-Reply-To <mailman.514.1347390405.27098.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=204.99.118.9; posting-account=ORZ1TAoAAADZ8GESKvoLbjy2tIM3TC3h
References <2cb240e2-7992-44eb-84cf-1aba5a411ee4@googlegroups.com> <mailman.514.1347390405.27098.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 204.99.118.9
MIME-Version 1.0
Subject Re: Single leading dash in member variable names?
From e.doxtator@gmail.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.516.1347396810.27098.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347396810 news.xs4all.nl 6950 [2001:888:2000:d::a6]:39556
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28901

Show key headers only | View raw


On Tuesday, September 11, 2012 2:06:45 PM UTC-5, Ian wrote:
> On Tue, Sep 11, 2012 at 12:45 PM,  I 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.

Thank you!

PEP 8 says this is bad form.  What do you think?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Single leading dash in member variable names? e.doxtator@gmail.com - 2012-09-11 11:45 -0700
  Re: Single leading dash in member variable names? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-11 13:06 -0600
    Re: Single leading dash in member variable names? e.doxtator@gmail.com - 2012-09-11 13:53 -0700
      Re: Single leading dash in member variable names? Terry Reedy <tjreedy@udel.edu> - 2012-09-11 17:34 -0400
    Re: Single leading dash in member variable names? e.doxtator@gmail.com - 2012-09-11 13:53 -0700
      Re: Single leading dash in member variable names? Erik Max Francis <max@alcyone.com> - 2012-09-11 15:02 -0700
        Re: Single leading dash in member variable names? Tim Chase <python.list@tim.thechases.com> - 2012-09-12 05:49 -0500
        Re: Single leading dash in member variable names? e.doxtator@gmail.com - 2012-09-12 08:23 -0700
          Re: Single leading dash in member variable names? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-12 10:52 -0600
          Re: Single leading dash in member variable names? mdengler@gmail.com - 2012-09-12 09:53 -0700
        Re: Single leading dash in member variable names? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-12 09:23 -0600
    Re: Single leading dash in member variable names? aahz@pythoncraft.com (Aahz) - 2012-11-10 07:41 -0800

csiph-web