Why does the _winreg module start with an underscore

Erik Max Francis max at alcyone.com
Fri May 19 15:17:00 EDT 2006


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.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   I wonder if heaven got a ghetto
   -- Tupac Shakur



More information about the Python-list mailing list