[Poll] Private variables

Alexandre Fayolle alf at orion.logilab.fr
Wed Sep 12 05:16:36 EDT 2001


It is possible in python to get private class members by using names 
beginning with 2 underscores, and finished by at least 1 underscore.

I personnally tend to use class member names beginning with one 
underscore to indicate that the member is 'internal' and should not
be called by external applications, and from looking at the standard
library source code, it seems that this is more common than the official
way mentionned hereabove.

I would like to hear what the opinion of pythoneers is on that topic. 

Please feel free to point me to the list archives if this has already 
debated over and over. 

Alexandre Fayolle
-- 
LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
Narval, the first software agent available as free software (GPL).



More information about the Python-list mailing list