On Fri, Sep 10, 2010 at 11:23 PM, Eli Bendersky <eliben@gmail.com> wrote:
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.
The module and docs changes both went in on August 17 as part of the same commit (r84133), so I'm not sure how you could have a local checkout with the module changes but not the doc changes. A checkout from early August wouldn't have either, of course.
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.
Yeah, I changed my mind and have now documented it properly. The 3.2 versionadded tag on show_code is currently a little questionable though. Guido actually checked in the original (undocumented) version of show_code before 3.0 was released. The only thing new about it in 3.2 is it being mentioned in the documentation. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia