Partial 1.0 - Partial classes for Python

greg greg at cosc.canterbury.ac.nz
Thu Feb 8 01:11:15 EST 2007


> Martin v. Löwis schrieb:
> 
>>A partial class is a fragment of a class definition;
>>partial classes allow to spread the definition of
>>a class over several modules.

When I want to do this, usually I define the parts
as ordinary, separate classes, and then define the
main class as inheriting from all of them. That
avoids the monkeypatching-like behaviour of what
you're doing -- the main class definition makes it
clear what parts it's made up of -- and it uses
only standard Python techniques, so it doesn't
harbour any surprises.

--
Greg



More information about the Python-list mailing list