About one class/function per module

metal metal29a at gmail.com
Mon Nov 2 03:00:45 CET 2009


On 11月2日, 上午9时27分, Peng Yu <pengyu... at gmail.com> wrote:
> On Sun, Nov 1, 2009 at 7:02 PM, alex23 <wuwe... at gmail.com> wrote:
> > On Nov 2, 8:11 am, Peng Yu <pengyu... at gmail.com> wrote:
> >> I prefer organized my code one class/function per file (i.e per module
> >> in python). I know the majority of programmers don't use this
> >> approach. Therefore, I'm wondering what its disadvantage is.
>
> > You mean, what disadvantages it has _other_ than the ones you've been
> > experiencing?
>
> > Aren't those enough to warrant actually working with Python's import
> > mechanism rather than against it?
>
> At least, I can use the following for now with one class/function per
> module. Unless this one class/function per module style have other
> disadvantages in term software engineering, I still can live with
> typing the class name (e.g. 'A') twice.
>
>  import test.A
>  a=test.A.A()
>
> So I am asking disadvantages besides python import mechanism is not
> friendly to it.

I recommand you double check django project, to learn how to organize
python project



More information about the Python-list mailing list