Peng Yu <pengyu...@gmail.com> writes:

> 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.

A property <URL:http://docs.python.org/library/functions.html#property>
named with a regular public attribute name::

    class Foo(object):

        def __init__(self, spam):
            self._spam = spam

        @property
        def spam(self):
            return self._spam

-- 
 \          “The only tyrant I accept in this world is the still voice |
  `\                                          within.” —Mahatma Gandhi |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to