Default indentation of 4 columns

Emile van Sebille emile at fenx.com
Sun Oct 24 18:06:49 EDT 1999


How about :

    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


At least here, the '):' is clear.



Emile van Sebille
emile at fenx.com
-------------------


----- Original Message -----
From: François Pinard <pinard at iro.umontreal.ca>
To: <python-list at python.org>
Sent: Sunday, October 24, 1999 7:16 AM
Subject: Default indentation of 4 columns


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


--
http://www.python.org/mailman/listinfo/python-list








More information about the Python-list mailing list