One module per class, bad idea?

Carl J. Van Arsdall cvanarsdall at mvista.com
Tue Dec 12 14:24:15 EST 2006


Isaac Rodriguez wrote:
>> Yes, it would be a bad idea. =)
>>     
>
> Saying it is a bad idea and not explaining why will not help anyone. I
> would like you to elaborate on why it is a bad idea to have one file
> per class.
>   
A module per class makes a lot of sense in some cases, or rather, make 
your module your class (look at the singleton pattern).  I actually like 
to structure all of my code like this, it helps me keep things organized 
and separated.  I guess i'm not sure why it would ever be a really bad 
idea, maybe if you had really small classes?

-c


-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list