One module per class, bad idea?

Carl Banks pavlovevidence at gmail.com
Tue Dec 12 18:13:37 EST 2006


Matias Jansson wrote:
> I come from a background of Java and C# where it is common practise to have
> one class per file in the file/project structure. As I have understood it,
> it is more common practice to have many classes in a Python module/file.
> What is the motivation behind it, would it be a bad idea to have a guideline
> in your project that promotes a one class per file structure (assuming most
> of the programmers a background similar to mine)?

One class per module is like having a filing system where you limit
yourself to one piece of paper per file.

(I think it's just convention, really.  You don't have to use one class
per module in Python, and given that freedom, most Python programmers
didn't.)


Carl Banks




More information about the Python-list mailing list