@ -1877,22 +1877,22 @@ CRITICAL:my_module:Running out of disk space.
2023-02-07 23:21:01,430 CRITICAL:my_module:Running out of disk space.
</code></pre></div>
<div><h2id="introspection"><ahref="#introspection"name="introspection">#</a>Introspection</h2><pre><codeclass="python language-python hljs"><list> = dir() <spanclass="hljs-comment"># Names of local vars, functions, classes and modules.</span>
<dict> = vars() <spanclass="hljs-comment"># Dict of local vars, functions, etc. Also locals().</span>
<dict> = globals() <spanclass="hljs-comment"># Dict of global vars, etc. (including '__builtins__').</span>
<div><h2id="introspection"><ahref="#introspection"name="introspection">#</a>Introspection</h2><pre><codeclass="python language-python hljs"><list> = dir() <spanclass="hljs-comment"># List of of local names (including functions and classes).</span>
<dict> = vars() <spanclass="hljs-comment"># Dict of local names and their objects. Also locals().</span>
<dict> = globals() <spanclass="hljs-comment"># Dict of global names (for instance '__builtin__' module).</span>
</code></pre></div>
<pre><codeclass="python language-python hljs"><list> = dir(<obj>) <spanclass="hljs-comment"># Names of all object's attributes (including methods).</span>
<dict> = vars(<obj>) <spanclass="hljs-comment"># Dict of writable attributes. Also <obj>.__dict__.</span>
<bool> = hasattr(<obj>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Checks if getattr() raises AttributeError.</span>
value = getattr(<obj>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Default value can be passed as the third argument.</span>
setattr(<obj>, <spanclass="hljs-string">'<attr_name>'</span>, value) <spanclass="hljs-comment"># Only works on objects with __dict__ attribute.</span>
delattr(<obj>, <spanclass="hljs-string">'<attr_name>'</span>) <spanclass="hljs-comment"># Same. Also `del <object>.<attr_name>`.</span>
<pre><codeclass="python language-python hljs"><list> = dir(<obj>) <spanclass="hljs-comment"># Returns names of all object's attributes (incl. methods).</span>
<dict> = vars(<obj>) <spanclass="hljs-comment"># Returns dict of writable attributes. Also <obj>.__dict__.</span>
<bool> = hasattr(<obj>, <spanclass="hljs-string">'<name>'</span>)<spanclass="hljs-comment"># Checks if object possesses attribute with passed name.</span>
value = getattr(<obj>, <spanclass="hljs-string">'<name>'</span>)<spanclass="hljs-comment"># Returns object's attribute or raises AttributeError.</span>
setattr(<obj>, <spanclass="hljs-string">'<name>'</span>, value)<spanclass="hljs-comment"># Sets attribute. Only works on objects with __dict__.</span>
delattr(<obj>, <spanclass="hljs-string">'<name>'</span>)<spanclass="hljs-comment"># Deletes attribute from __dict__. Also `del <obj>.<name>`.</span>
<li><strong>Coroutines have a lot in common with threads, but unlike threads, they only give up control when they call another coroutine and they don’t use as much memory.</strong></li>
@ -2927,7 +2927,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the active