[Python-Dev] terminology for "free variables" in Python

Nick Coghlan ncoghlan at gmail.com
Fri Sep 10 14:41:59 CEST 2010

On Fri, Sep 10, 2010 at 5:06 PM, Eli Bendersky <eliben at 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 ;)

The omission from __all__ (and hence the module help text) was
accidental and is now fixed.

The omission of show_code from the documentation was deliberate, and
I've now added a comment to that effect (the history is that
dis.show_code has been around, but undocumented, for a while. The fact
that it printed directly to stdout rather than producing a formatted
string was mildly irritating, so I refactored the formatting part out
into code_info, leaving just a single print call in show_code. Since I
only kept show_code around for backwards compatibility reasons, I
don't see any point in advertising its existence - better for people
to just call code_info and print the result themselves.

Although it *is* somewhat handy for quick introspection at the
interpreter prompt... maybe I should document it after all. Thoughts?


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list