Gabriel Genellina wrote: >> >>> co.co_consts[list(co.co_names).index("__doc__")] >> 'This is a docstring' > > Good! I'll buy this one :) thanks!
however, there's no 1:1 mapping between names and constants; if you want code that works by accident, you might as well use co_consts[0]. </F> -- http://mail.python.org/mailman/listinfo/python-list