Partial 1.0 - Partial classes for Python

J. Clifford Dyer webmaster at cacradicalgrace.org
Thu Feb 8 12:29:34 EST 2007


Martin v. Löwis wrote:
> I'm happy to announce partial 1.0; a module to implement
> partial classes in Python. It is available from
> 
> http://cheeseshop.python.org/pypi/partial/1.0
> 
> A partial class is a fragment of a class definition;
> partial classes allow to spread the definition of
> a class over several modules. One location serves
> as the original definition of the class.
> 
> To extend a class original_module.FullClass with
> an additional function, one writes
> 
> from partial import *
> import original_module
> 

Erm,

Please don't use 'from x import *', especially in a demo example like
this.  It makes it less clear which variables below come from your  module.

Thanks,
Cliff

> class ExtendedClass(partial, original_module.FullClass):
>     def additional_method(self, args):
>         body
>     more_methods
> 
> This module is licensed under the Academic Free License v3.0.
> 
> Please send comments and feedback to martin at v.loewis.de



More information about the Python-list mailing list