[docs] [issue16355] inspect.getcomments() does not work in the interactive shell

R. David Murray report at bugs.python.org
Mon Oct 29 18:18:30 CET 2012

R. David Murray added the comment:

Not a specific package, but a specific use case (assuming getcomments is in use at all :)

Consider a program that uses getcomments to look for a pragma-like comment before a function, but one that is not critical to the program's function (perhaps it has to do with testing or tracing infrastructure...).  If the source file does not exist, then that is equivalent to their being no pragma.  So the program would work fine even if the source is deleted...until this getcomments starts to raise an error, when it promptly crashes (probably in a production system, since that is the most likely place for source to be absent...)


Python tracker <report at bugs.python.org>

More information about the docs mailing list