[Tutor] single underscore convention?

Remco Gerlich scarblac@pino.selwerd.nl
Wed, 30 May 2001 17:28:47 +0200


On  0, Sean 'Shaleh' Perry <shalehperry@home.com> wrote:
> > 
> >       _def _test1():
> >               print animals[0]    # print Mammals
> >               animals.printtree()
> > 
> >       blah blah blah
> > 
> >       _test1()
> > 
> > Why the underscore, is this a convention?
> > 
> 
> Names with a leading underscore are a convention used for denoting an item is
> for internal use only and not meant to be exported. 

Especially, a 'from module import *' statement will not import any names
starting with an underscore.

Btw, '_def' there is a syntax error, you were overdoing it :)

-- 
Remco Gerlich