[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gzz] PEG coding_standard--vegai: Coding Standard (revised)
From: |
Tuomas Lukka |
Subject: |
Re: [Gzz] PEG coding_standard--vegai: Coding Standard (revised) |
Date: |
Wed, 5 Feb 2003 10:27:13 +0200 |
User-agent: |
Mutt/1.4i |
On Wed, Feb 05, 2003 at 06:07:14PM +0200, Vesa Kaihlavirta wrote:
> > > 4. After rcsid, the imports (unless there's a good reason to delay
> > > importing).
> > >
> > > - Prefer "import foo" to "from foo import bar".
> > > - Prefer "from foo import bar" to "from foo import \*".
> > > - No more than one import package in one line, except when importing
> > > gzz and java::
> > >
> > > import os, sys # Preferably no.
> > >
> > > import os # Yes.
> > > import sys
> > >
> > > import gzz, java # Yes.
> >
> > Exceptions: importing from current package, i.e.
> > in gzz/view/buoy/buoymanager.py,
> > from gzz.view.buoy import *
> > should be ok
>
> But "prefer something" implies "if necessary, break this rule", does it not?
Absolutely. It's simply good form to give examples here as to when it's more
acceptable and when not.
> > > 5. Imports should be grouped in the following order:
> > >
> > > - standard python imports
> > > - 3rd party python imports
> > > - java imports
> > > - gzz imports
> > >
> > > * imports should be in alphabetical order in the groups
> >
> > alphabetical? Why in the world?
>
> This was Benja's comment from few weeks back, and it faced no
> opposition then. I don't find it important personally.
I'd prefer phrasing this a bit looser:
Within a group, there is no fixed order. If you really want one,
use alphabetical.
Benja: what do you think?
> > > 10. Tab-size is 8 (will be converted to spaces by make committable),
> > > indentation
> > > at 4 spaces.
> > >
> > > 11. Never use tabs.
> >
> > Like mudyc said, this could probably be expressed better.
>
> Rephrased:
>
> 10. Tab-size is 8, indentation at 4 spaces.
>
> 11. Run make committable before committing code.
>
> - converts tabs to 8 spaces
> - runs tests
Already replied to this to commit message.
Tuomas