[Zope] Re: Published methods and docstrings

Paul Tiemann pault@center7.com
12 Dec 2002 11:11:22 -0700


Hi Andrew,

> I'm a newcomer to Zope, and while mostly it seems attractive...

I hope this little clarification will help to make Zope more wholly
attractive ;)

> there's one thing that to me seems downright wrong: the use of
> docstrings to differentiate between published and private (wrt
> the web) objects (methods in particular).

I'm only going to try to help based on my limited knowledge.  If I'm
incorrect, somebody please help me to understand this better as well--

*) Public visibility requires a docstring.  but...

*) A docstring alone doesn't result in public visibility.

*) What really makes a thing "private" is to prefix its 
   name with an underscore.

Example:

def public_hello(self,REQUEST=None):
    """This method returns Hello World, you can call me TTW"
    return "Hello World"

def _private_hello(self,REQUEST=None):
    """Even though I have a docstring, you can't call me TTW"""
    return "Hello World"

--
Paul