What are the naming convention for private member variable, and private and public member function?

Daniel Fetchinson fetchinson at googlemail.com
Sun Sep 20 01:44:39 EDT 2009


> It says in http://www.python.org/dev/peps/pep-0008/
>
> "    Method Names and Instance Variables
>
>       Use the function naming rules: lowercase with words separated by
>       underscores as necessary to improve readability.
>
>       Use one leading underscore only for non-public methods and
> instance
>       variables."
>
> I am wondering what is the different between member function and
> member variable in term of naming convention.

Nothing that I know of. If they are "private" they should both start
with an underscore, if they are "public" they should not.

HTH,
Daniel



-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown



More information about the Python-list mailing list