Doc strings for a standalone app??

Rick L. Ratzel rick.ratzel at
Wed Jun 9 21:03:27 CEST 2004

    I think docstrings have a legitimate disadvantage in certain 
situations.  If you use a hash-sign comment, you're guaranteed that it 
won't be in the binaries, which is a big advantage to some if that 
comment contains highly sensitive documentation.


Peter Hansen wrote:
> Rick L. Ratzel wrote:
>> The only perceived disadvantages that I'm aware of occur when you 
>> don't use the -OO flag.  Docstrings end up in frozen executables and 
>> .pyc files, visible through the use of the "strings" command (which is 
>> a problem for people who think the information is hidden from the 
>> binary file like a comment).  The binary files are also ever so 
>> slightly larger when docstrings are used instead of comments.  
>> However, using -OO removes docstrings in addition to applying 
>> optimizations...the frozen executable or resulting .pyo files have no 
>> docstrings and are a bit smaller.
> Good point, but this is hardly a disadvantage of docstrings *relative
> to regular comments*, which aren't even included in the .pyc files
> under any conditions, -OO or not...
> -Peter

More information about the Python-list mailing list