About one class/function per module

Diez B. Roggisch deets at nospam.web.de
Sun Nov 1 23:32:00 CET 2009

Peng Yu schrieb:
> I recently asked how to support one class/function per module under
> the title 'How to import only one module in a package when the package
> __init__.py has already imports the modules?' I summarize my key
> points below. In particular, I have to two questions:
> 1. What disadvantages there are to enforce one class/function per file?
> 2. How to better support one class/function per file in python?

Are you aware that it's much easier to just let go about your 
preconceptions about how things should work, and instead adapt for 
*Pythocode* to the way *Python* works? The energy you've invested in 
coming up with contrived reasons for why e.g. one file per function is a 
good idea is better spent actually programming Python - and ejoying it.


More information about the Python-list mailing list