I have a series of subclasses that inherit methods from a base class, but 
I'd like them to have their own individual docstrings. The obvious 
solution (other than copy-and-paste) is this:


class Base(object):
    colour = "Blue"
    def parrot(self):
        """docstring for Base"""
        return "Norwegian %s" % self.colour


class SubClass(Base):
    colour = "Red"
    def parrot(self):
        """docstring for Subclass"""
        return super(Subclass, self).parrot()


but that adds an awful lot of boilerplate to my subclasses. Are there any 
other good solutions to this problem?



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to