Version numbers in traceback

Toby Dickenson tdickenson at
Thu Jul 26 03:59:03 EDT 2001

Martin von Loewis <loewis at> wrote:

>Dale Strickland-Clark <dale at> writes:
>> Is there a standard way for a module to register its version number so that it is reported by
>> traceback or other debugging tools.
>> I thought something nice and simple like 
>> _Module_Version_ = '10.5C'
>> would be nice.
>The standard constant for a module version is __version__. However,
>there is no way to integrate it into a traceback. Instead, debugging
>tools would need to find out the module of each function in the
>traceback themselves (which sometimes cannot be done), and then access
>the __version__ if desired. I don't think that the traceback module
>should fetch __version__, though.

Zope already does something similar; if a function has a local
variable __traceback_info__ then this is included as an extra line in
the traceback. I find this *very* handy.

Toby Dickenson
tdickenson at

More information about the Python-list mailing list