Req. for module style/organization

RayS rays at blue-cove.com
Mon Feb 20 11:37:59 EST 2006


Thanks Ziga,

At 04:42 PM 2/19/2006, you wrote:
>RayS wrote:
> > I realize that I need to make some changes to follow
> > http://www.python.org/doc/essays/styleguide.html
> > better. Does anyone have an appropriate URL for me to follow for this
> > task? Is one of the C-module guides appropriate?
> >
>
>There are two informal Python Enhancements Proposals:
>Style Guide for C Code - http://www.python.org/peps/pep-0007.html
>Style Guide for Python Code - http://www.python.org/peps/pep-0008.html

Thanks, those are helpful and show that I should do some editing throughout.

The
import .moduleName
for relative imports might come into play, as each of the modules of 
the package require the use of LXSerial (oops, I mean: lxserial.Serial :-) )

Given the example structure from Guido:
http://www.python.org/peps/pep-0328.html#guido-s-decision
package/
     __init__.py
     subpackage1/
         __init__.py
         moduleX.py
         moduleY.py
     moduleA.py

seems like it would be appropriate here, but I still need to decide 
on the appropriate hierarchy within the package.
Should it be
lx200/
     __init__.py
     devices/
         __init__.py
         drive.py
         focuser.py
     lxserial.py

which reflects usage hierarchy, or

lx200/
     __init__.py
     drive.py
     focuser.py
     lxserial.py

which is simpler...

I still don't see a consistent rationale where some packages have 
empty __init__.py with all the init stuff in the modules, and others don't.

And then there's the large-ish modules like wxPyPlot that have almost 
everything in one module - I assume that is discouraged.

Thanks for the info,
Ray




More information about the Python-list mailing list