Default indentation of 4 columns

François Pinard pinard at iro.umontreal.ca
Sun Oct 24 10:16:29 EDT 1999


Hi, people.  I'm reasonably trying to follow Guido's style guide, somewhat
helped in doing so by the nice Emacs Python mode.

The only thing that really rebukes me is the interdiction to use capitals in
comments to mark non-terminals (or variables), as it does not get accompanied
by a better suggestion, or at least, none yielding as much clarity.

The 4 columns indentation rule is quite acceptable on average, expect when
I have things like, say:

    for file_name, line_number, function_name, python_text in frames:
        if (function_name[0] not in ('_', '<')
            and function_name not in transparent_functions):
            name = os.path.basename(file_name)
            if name not in transparent_files:
                return name, line_number

The pseudo-alignment of the `and' with `name' is rather ugly to my eyes.
It would be alleviated a bit by using `\' on the preceding line instead
of `(', but the style guide suggests that we favour '(', which looks
like a good thing.  Do some of you share my little irritation, here?
Would someone have developed some elegant and easy compromise?  I hardly
see one, but who knows, people sometimes have unexpectedly good ideas! :-)

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list