On Fri, Sep 10, 2010 at 15:41, Nick Coghlan <ncogh...@gmail.com> wrote:
> On Fri, Sep 10, 2010 at 5:06 PM, Eli Bendersky <eli...@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 ;) > When you say "is in the normal documentation", do you mean you added it recently ? Although I see it here: http://docs.python.org/dev/py3k/library/dis.html, it's neither in the docs of 3.1.2 (http://docs.python.org/py3k/library/dis.html), nor in 2.7, nor in a build of 3.2 I have lying around from a couple of weeks ago. 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
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com