Chris Lasher a écrit : > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file per class. He asked why, and frankly, his valid > question has me flummoxed.
In Java, you HAVE to place a class in it's own file. That's how the language works. But in Java, you do not have to place each class in it's own module/package, in fact, it would be bad. It's the same in Python: you do not want to have one class per module/package. Unfortunately, in Python, a module/package is a file, and in Java, it's a directory. Also, Python doesn't really have the notion of a "root package/module". Translation: "import foo; foo.foo()" sucks so avoid having only one class per module :) -- http://mail.python.org/mailman/listinfo/python-list