creating classes with mix-ins

Carl Banks pavlovevidence at
Wed May 13 00:38:18 CEST 2009

On May 12, 4:45 am, samwyse <samw... at> wrote:
> Unfortunately, 'boilerplate()' uses the handlers that I provide when
> MetaBlog is instantiated.

In that case, the handler functions should be attributes of the
instance, not of the class.  Do something like this:

class MetaBlog(object):
    def __init__(self): = blogHander()
        for name in

    def boilerplate(self,name):
        method = getattr(,name)
        def template(*args):
        return template

Carl Banks

More information about the Python-list mailing list