Why does the _winreg module start with an underscore

3c273 nospam at nospam.com
Fri May 19 15:32:53 EDT 2006


"Erik Max Francis" <max at alcyone.com> wrote in message
news:K5GdnVSKDaAwhPPZnZ2dnUVZ_vydnZ2d at speakeasy.net...
> 3c273 wrote:
>
> > Does it signify something? Just curious.
>
> Dear quasar,
>
> Typically an identifier starting with an underscore signifies something
> that is not intended to be exposed as part of a public API.  In other
> words, it's an implementation detail in whatever you're using and as
> such you probably shouldn't use it or rely on it, unless you know the
> internal details very well.  An identifier starting with _two_
> underscores is automatically mangled in a way that makes it more
> difficult (but not impossible) for external clients to accidentally use
> them.
>
Thanks for the explanation. (Fellow astronomer?)
Louis





More information about the Python-list mailing list