Partial classes

Rob Williscroft rtw at freenet.co.uk
Wed Jul 19 14:08:58 EDT 2006


Bruno Desthuilliers wrote in news:44be40c1$0$21612$636a55ce at news.free.fr
in comp.lang.python: 

> John Salerno wrote:
>> Marc 'BlackJack' Rintsch wrote:
>> 
>>> Can you flesh out your use case a little bit and tell why you can't
>>> solve the problem with inheritance or a meta class?
>> 
>> 
>> From my experience with C#, the only real use for partial classes is
>> when you want to separate your GUI code from the rest of your logic.
> 
> What the ... is GUI code doing in a domain object ???

It doesn't (shouldn't) really work like that.

The partial classes are used by GUI designer tools (Visual Studio[1] 
and SharpDevelop[2] for example) to seperate code that the tool generates 
from code (event handlers etc) that the programmer writes.

IOW hopefully both parts of the class have GUI code in them.

[1] http://msdn.microsoft.com/vstudio/
[2] http://www.sharpdevelop.net/OpenSource/SD/

Rob.
-- 
http://www.victim-prime.dsl.pipex.com/



More information about the Python-list mailing list