<div dir="ltr"><br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">There's a slight inconsistency. The names a code object explicitly<br>
calls out as free variables (i.e. references to cells in outer scopes)<br>
are only a subset of the full set of free variables (every referenced<br>
name that isn't a local variable or an attribute).<br>
<br>
>>> from dis import show_code<br>
>>> def outer():<br>
... x, y = 1, 2<br>
... def inner():<br>
... print (x, y, a, b, c.e)<br>
... return inner<br>
...<br>
>>> f = outer()<br>
>>> show_code(f)<br></blockquote></div><br>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.<br>
<br>Eli<br><br></div>