On Fri, Sep 10, 2010 at 15:41, Nick Coghlan
<ncoghlan@gmail.com> wrote:
On Fri, Sep 10, 2010 at 5:06 PM, Eli Bendersky <
eliben@gmail.com> wrote:
> Nick, did you know that dis.show_code is neither exported by default from
> the dis module, nor it's documented in its help() or .rst documentation?
> Neither is code_info(), which is used by show_code(). I wonder if this is
> intentional.
code_info is in the normal documentation. I even remembered the
versionadded tag without Georg reminding me ;)
Although it *is* somewhat handy for quick introspection at the
interpreter prompt... maybe I should document it after all. Thoughts?
I mostly use the dis module for quick-n-dirty exploration of the results of compilation into bytecode, and I'm sure many people use for the same effect. Thus show_code seems like a convenient shortcut, although not a necessary one. The string returned by code_info isn't interactive-shell friendly, and show_code saves the print(...).
Personally I think that if it's there, it should be documented. If it's better not to use it, it should be removed or at least marked deprecated in the documentation/docstring.
Eli