B
bertgoos
Hey, I have the following code that has to send every command it
receives to a list of backends. Instead of:
class MultiBackend(object):
"""Renders to multiple backends"""
def __init__(self, backends):
self.backends = backends
def flush(self):
for b in self.backends:
b.flush()
def draw(self):
for b in self.backends:
b.draw()
I would like to write each method like:
flush = multimethod()
Is that possible using new-style classes?
Bert
receives to a list of backends. Instead of:
class MultiBackend(object):
"""Renders to multiple backends"""
def __init__(self, backends):
self.backends = backends
def flush(self):
for b in self.backends:
b.flush()
def draw(self):
for b in self.backends:
b.draw()
I would like to write each method like:
flush = multimethod()
Is that possible using new-style classes?
Bert