Comments

Peter Hansen peter at engcorp.com
Thu May 9 01:03:08 EDT 2002


Terry Reedy wrote:
> 
> "Sean 'Shaleh' Perry" <shalehperry at attbi.com> wrote in message
> news:mailman.1020875117.14656.python-list at python.org...
> > Sure, but comments are basically free whereas the above creates an
> anonmymous
> > string which has to be garbage collected.
> 
> I once read, I believe, that free-floating (unbound) strings that do
> not become doc strings are eliminated (in batch mode) during
> compilation.

Just confirmed this by examining a .pyc file.  Doc-strings in the
module level and in a function were present, but free-floating
strings immediately following did not appear.  Sounds like that
makes them fairly effective for commenting-out purposes, although
for real comments the octothorpe is still a better choice IMHO.

-Peter



More information about the Python-list mailing list