[Python-3000] C style guide (was: C API changes?)

Brett Cannon brett at python.org
Thu Mar 23 00:14:06 CET 2006


On 3/22/06, Thomas Wouters <thomas at python.org> wrote:
[SNIP]
> Speaking of PEP-3007, any ideas on how different from PEP-0007 it'll be?
> tabs or four-space indents? How rigourously will it be applied? (I honestly
> don't have any problems with PEP-0007 except for its intermittent
> application.) Do we get to arbitrarily clean up extensions and the like? :>

Yes, please!  I think for the Py3K codebase we should at least require
code meet the style guide.  We are all guilty of having ignored it at
some point, but over the years it has made the C code a pain to edit
since you have to pay attention to the formatting of the code around
where you are touching which can vary from file to file, making
multi-file patches a pain to review.  Plus if we require this before
we add new code in it will help guarantee at least a basic code
review.

Plus I would like to say that upping the amount of source comments
would be a very good thing.  While we do tend to have great comments
that cover really technical stuff (usually from Tim), we tend not to
comment on what a function does or why it exists.  While it might be
obvious to some, it won't be to someone who is just stepping into
Python development.  Hell, I still sometimes have to spend a good
amount of time jumping around and grepping to figure out what a
function does or why it is there.  We are already used to doing simple
docstrings for Python code so I don't see extending this to C code as
a huge overhead.

-Brett


More information about the Python-3000 mailing list