|
|
@ -1831,7 +1831,7 @@ CRITICAL:my_module:Running out of disk space. |
|
|
|
<dict> = globals() <span class="hljs-comment"># Dict of global names and their objects, e.g. __builtin__.</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
<pre><code class="python language-python hljs"><list> = dir(<obj>) <span class="hljs-comment"># Returns names of all object's attributes (incl. methods).</span> |
|
|
|
<pre><code class="python language-python hljs"><list> = dir(<obj>) <span class="hljs-comment"># Returns names of object's attributes (including methods).</span> |
|
|
|
<dict> = vars(<obj>) <span class="hljs-comment"># Returns dict of writable attributes. Also <obj>.__dict__.</span> |
|
|
|
<bool> = hasattr(<obj>, <span class="hljs-string">'<name>'</span>) <span class="hljs-comment"># Checks if object possesses attribute with passed name.</span> |
|
|
|
value = getattr(<obj>, <span class="hljs-string">'<name>'</span>) <span class="hljs-comment"># Returns object's attribute or raises AttributeError.</span> |
|
|
|