[Zope3-dev] Re: New Pyskel changes

Guido van Rossum guido@python.org
Tue, 09 Jul 2002 08:26:33 -0400


[Stephan]
> Often interfaces are very "clean" and simple. I think having
> __doc__-copying statements flying around everywhere makes is quiet a
> bit dirty looking. But then I am the extreme case of having
> good-looking readable code. :-)

I encourage a change to pyskel.py that copies the docstring from the
interface into the source, rather than copying it at run-time.  I
agree that the run-time copying does nobody any good and makes it
ugly.  The main use for docstrings is still for the benefit of the
human who reads the source code.  Having to look in a different file
for the doc string disrupts the process of understanding the code.

IMO the output from the example should look like this:

----------------------------------------------------------------------
from Zope.App.Security.IRoleService import IRoleService

class RoleService:
    __doc__ = IRoleService.__doc__

    __implements__ =  IRoleService

    ############################################################
    # Implementation methods for interface
    # Zope.App.Security.IRoleService.IRoleService

    def getRole(self, rid):
        """Return an 'IRole' object for the given role id."""

    def getRoles(self):
        """Return a sequence of the roles (IRole objects)
        defined in the place containing the service."""

    #
    ############################################################
----------------------------------------------------------------------

--Guido van Rossum (home page: http://www.python.org/~guido/)