why no block comments in Python?

Terry Hancock hancock at anansispaceworks.com
Sat Mar 11 02:49:47 CET 2006


On Sat, 11 Mar 2006 10:23:56 +1100
"Steven D'Aprano" <steve at REMOVETHIScyber.com.au> wrote:

> On Thu, 09 Mar 2006 18:02:27 -0600, Terry Hancock wrote:
> 
> > On 9 Mar 2006 07:21:00 -0800
> > "msoulier" <msoulier at gmail.com> wrote:
> >> > (and if you don't, you can quickly comment out
> >regions > > by putting them inside a triple-quoted
> >string.) > 
> >> Although that will use up memory, as opposed to a
> >comment.
> > 
> > Not really. Unless it is the first string in the block
> > (class, function, module), it won't be assigned to
> > anything, and will be immediately garbage-collected.
> > 
> > It may consume space in the pyc file, I'm not sure.
> 
> I don't believe this is true. Unassigned strings other
> than the doc string are not compiled into the code:

[bytecode analysis snipped]

Cool. I thought that was probably true, but didn't want
to guess.

Cheers,
Terry


-- 
Terry Hancock (hancock at AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com




More information about the Python-list mailing list