Alternative docstring implementation (Re: doc strings and efficiency)

Tim Roberts timr at probo.com
Wed Oct 3 02:34:54 EDT 2001


Greg Ewing <greg at cosc.canterbury.ac.nz> wrote:

>Instead of keeping docstrings in memory, perhaps the
>interpreter should just keep a reference to their locations 
>in the .pyc file, and pull them out when the __doc__
>attribute is referenced.

Not worth it.  The entire standard Python library in its full, uncompiled
source form is only 1.8MB.  Even if half of that was doc strings, it's less
than a megabyte.  Better to blow the memory and skip the computational and
disk overhead.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list