What is the naming convention for accessor of a 'private' variable?

Peng Yu pengyu.ut at gmail.com
Thu Nov 19 03:27:47 CET 2009


http://www.python.org/dev/peps/pep-0008/

The above webpage states the following naming convention. Such a
variable can be an internal variable in a class. I'm wondering what is
the naming convention for the method that access such variable.

    - _single_leading_underscore: weak "internal use" indicator.  E.g. "from M
      import *" does not import objects whose name starts with an underscore.



More information about the Python-list mailing list