Why does the _winreg module start with an underscore

E

Erik Max Francis

3c273 said:
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.
 
3

3c273

Erik Max Francis said:
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
 
F

Fredrik Lundh

3c273 said:
Does it signify something? Just curious.

from the module documentation:

This module exposes a very low-level interface to the Windows
registry; it is expected that in the future a new winreg module
will be created offering a higher-level interface to the registry
API.

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top