One module per class, bad idea?
Gabriel Genellina
gagsl-py at yahoo.com.ar
Fri Dec 22 20:03:31 EST 2006
At Friday 22/12/2006 12:56, Kent Johnson wrote:
>It does make the imports look funny - I tend to give the module the same
>name as the class, Java style, so I have
>from foo.bar.MyClass import MyClass
>but that is a minor point IMO.
You can always arrange things at the module level (inside
__init__.py) so from "outside", people can say:
from foo.bar import MyClass
if you consider MyClass being in its own module an implementation
detail that should be hidden.
<opinion class=personal>Module layout is an important design concept</opinion>
--
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
More information about the Python-list
mailing list