Spread a class over multiple files

dieter dieter at handshake.de
Mon Jun 6 03:16:19 EDT 2016


Mark Summerfield <list at qtrac.plus.com> writes:

> Sometimes I want to spread a class over multiple files.

When I run into such a use case, I use (multiple) inheritance --
with "mixin class"es.

Each "mixin class" handles some important aspect and is only loosely
coupled with maybe a common base class and the other aspects.
The main application class integrates the mixin classes via inheritance --
when it needs to handle the respective aspect.

Each mixin class can be implemented in its own file.



More information about the Python-list mailing list