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

Nick Coghlan ncoghlan at gmail.com
Sat Sep 11 01:59:44 CEST 2010


On Sat, Sep 11, 2010 at 6:46 AM, Georg Brandl <g.brandl at gmx.net> wrote:
> [me]
>> Although it *is* somewhat handy for quick introspection at the
>> interpreter prompt... maybe I should document it after all. Thoughts?
>
> IMO show_code() is not a good name, because the only thing it doesn't
> do is to -- show the code.
>
> I'd rather call it "codeinfo" (which also is more in line with current
> dis module function names).

And, indeed, the variant I added that just returns the formatted
string instead of printing it directly to stdout is called
dis.code_info.

dis.show_code is the existing helper that Guido added way back in
2007. As the checkin comment from back then put it, it shows you
everything the interpreter knows about the code object except the
details of the bytecode (which is already covered by dis.dis).

So while I agree the name isn't great, I also don't think it is wrong
enough to bother changing.

Cheers,
Nick.

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


More information about the Python-Dev mailing list