Laura Creighton wrote:
don't fear mixins and multiple
inheritance unduly.  They are a practical solution for a lot of
problems.  You might have one of them.

I don't think mixins are a solution here, because they
still require controlling the instantiation of the classes
so that you can substitute a class that incorporates the
mixin.

This seems like a case of "adding new operations to
existing things", for which the functional style is
appropriate.

If dispatching on the classes of the objects is needed,
perhaps some implementation of generic functions may
be of help, such as functools.singledispatch in Python
3.4, or PEAK-Rules.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to