Medium to Large Scale Python Deployments

Peter Hansen peter at engcorp.com
Fri Jun 7 19:24:47 EDT 2002


Bengt Richter wrote:
> 
> Is the "comments" number a count of _pure_ comment lines,
> # (like this one) ?

I believe so.  I haven't examined the pycount code yet.

> I think it would be interesting to analyze comments further,
> to see what the relative comment byte count is overall,
> and for lines with both code and comments,
> """like this line:""" # (this has code and comment).

I consider it a mild stylistic no-no to use line-ending
comments, personally.  I believe it's almost always better
to put a block-comment of one or more lines above a block
of code with related purpose.  A good comment there tends to
be more maintainable, and useful, than lots of little comments
on each line.

> Also maybe separate doc-string lines into a separate category,
> since they have a dual nature.

I believe pycount does separate out doc-strings.  There is a
separate column labelled "doc" which, in our code, was relatively
small (we rarely use doc strings, having avoided that aspect of
Python when writing on an embedded system where all the .pyc 
files were stored in our limited 1MB of flash along with the 
interpreter...).

-Peter



More information about the Python-list mailing list