Browse Source

Introspection

pull/46/head
Jure Šorn 4 years ago
parent
commit
960d1cb896
2 changed files with 6 additions and 6 deletions
  1. 6
      README.md
  2. 6
      index.html

6
README.md

@ -2090,9 +2090,9 @@ Introspection
### Variables
```python
<list> = dir() # Returns names of variables in current scope.
<dict> = locals() # Returns dict of local variables. Also vars().
<dict> = globals() # Returns dict of global variables.
<list> = dir() # Returns names of variables in current scope.
<dict> = locals() # Returns dict of local variables. Also vars().
<dict> = globals() # Returns dict of global variables.
```
### Attributes

6
index.html

@ -1830,9 +1830,9 @@ product_of_elems = functools.reduce(op.mul, &lt;collection&gt;)
LogicOp = enum.Enum(<span class="hljs-string">'LogicOp'</span>, {<span class="hljs-string">'AND'</span>: op.and_, <span class="hljs-string">'OR'</span> : op.or_})
last_el = op.methodcaller(<span class="hljs-string">'pop'</span>)(&lt;list&gt;)
</code></pre>
<div><h2 id="introspection"><a href="#introspection" name="introspection">#</a>Introspection</h2><p><strong>Inspecting code at runtime.</strong></p><div><h3 id="variables">Variables</h3><pre><code class="python language-python hljs">&lt;list&gt; = dir() <span class="hljs-comment"># Returns names of variables in current scope.</span>
&lt;dict&gt; = locals() <span class="hljs-comment"># Returns dict of local variables. Also vars().</span>
&lt;dict&gt; = globals() <span class="hljs-comment"># Returns dict of global variables.</span>
<div><h2 id="introspection"><a href="#introspection" name="introspection">#</a>Introspection</h2><p><strong>Inspecting code at runtime.</strong></p><div><h3 id="variables">Variables</h3><pre><code class="python language-python hljs">&lt;list&gt; = dir() <span class="hljs-comment"># Returns names of variables in current scope.</span>
&lt;dict&gt; = locals() <span class="hljs-comment"># Returns dict of local variables. Also vars().</span>
&lt;dict&gt; = globals() <span class="hljs-comment"># Returns dict of global variables.</span>
</code></pre></div></div>

Loading…
Cancel
Save