Re: how to arrange classes in .py files?

2009-03-27 Thread David L. Jones
On Mar 26, 8:51 pm, Kent kent.y...@gmail.com wrote: ... Is there any convention how to manage python classes into .py files? ... In above packages, each .py file contains one python class. And ClassName = Filename ... Can anyone give some hint on it? would be great with reason. Overall,

Re: how to arrange classes in .py files?

2009-03-27 Thread Kent
On Mar 27, 3:01 pm, David L. Jones david.l.jo...@gmail.com wrote: On Mar 26, 8:51 pm, Kent kent.y...@gmail.com wrote: ... Is there any convention how to manage python classes into .py files? ... In above packages, each .py file contains one python class. And ClassName = Filename

Re: how to arrange classes in .py files?

2009-03-27 Thread Michael Torrie
Kent wrote: In java, usually a .java file contains One Class. I read some python codes, I found one py file can have many classes and functions. Is there any convention how to manage python classes into .py files? In python we have a real name space, the primary unit being the module. Think

Re: how to arrange classes in .py files?

2009-03-27 Thread Terry Reedy
Kent wrote: thanks you guys' explaination. I did some refactory on my codes. Now it look's like: myapp/ # this is a package, it is the root package - gui/ # this is package, contains all gui related modules - mainFrame.py - dao.py # all daos are in this module - service.py #

how to arrange classes in .py files?

2009-03-26 Thread Kent
Hi all, I work with Java. Recently I read some about python, and it is really impressive. So i decide to learn it in my spare time by a small application. But i got a question about the python classes. Didn't find any help with Google. In java, usually a .java file contains One Class. I read

Re: how to arrange classes in .py files?

2009-03-26 Thread Terry Reedy
Kent wrote: In above packages, each .py file contains one python class. And ClassName = Filename not sure about the right code structure of python oop. Group related objects into one module. People of course differ on lumping versus splitting. Can anyone give some hint on it? would be

Re: how to arrange classes in .py files?

2009-03-26 Thread bearophileHUGS
Kent: Now I just deal with my little application exactly in Java style: package: gui, service, dao, entity, util If those things are made of a small enough number of sub things and such sub things are small enough, then you may use a single module for each of those Java packages (or even less).