[Ns-developers] ns-3 source code style issues

Gustavo Carneiro gjcarneiro at gmail.com
Sat Oct 14 04:43:09 PDT 2006


On 10/14/06, mathieu lacage <Mathieu.Lacage at sophia.inria.fr> wrote:
>
> On Wed, 2006-10-11 at 12:00 +0100, Gustavo Carneiro wrote:
> > On 10/10/06, mathieu lacage <Mathieu.Lacage at sophia.inria.fr> wrote:
> >         On Mon, 2006-10-09 at 19:08 +0100, Gustavo Carneiro wrote:
> >
> >         > Finally, about there is no mention in the document about how
> >         to style Python
> >         > code.  I see at least two files with different styles
> >         already:
> >         >
> >         >    1. The toplevel build.py file is indented with one tab;
> >         >    2. util/grid.py is indented with 4 spaces;
> >         >
> >         > For the Python style, I strongly suggest simply "follow PEP
> >         8"[1], which
> >         > indicates a 4 space indentation as in util/grid.py
> >
> >         patches which fix the coding style of 1) to be that of 2) are
> >         pre-approved.
> >
> > These commands will fix the indentation of build.py:
> >
> > $ cd ns-3
> > $ python /path/to/python-source/Tools/scripts/reindent.py build.py
>
> will do.


  Thanks.

  But if you want to be more completely PEP 8 compliant, I would suggest you
remove the spacing between function name and the opening brace, i.e. write
func(args) instead of func (args).  The reindent.py script provided by
python doesn't do that, but I have some elisp code that I'm willing to share
if anyone wants...

  Regards,

-- 
Gustavo J. A. M. Carneiro
"The universe is always one step beyond logic."


More information about the Ns-developers mailing list