@ -824,13 +824,12 @@ import <package>.<module> # Imports a built-in or '<package>/<module>.py'.
* **Package is a collection of modules, but it can also define its own objects.**
* **On a filesystem this corresponds to a directory of Python files with an optional init script.**
* **Running `'import <package>'` does not automatically provide access to the package's modules unless they are explicitly imported in its init script.**
* **Imports are relative to the location of file that was passed to python command, but can be made relative to their own location with `'from .[…][<file>[.…]] import <obj>'`.**
Closure
-------
**We have/get a closure in Python when:**
* **A nested function references a value of its enclosing function and then**
* **the enclosing function returns the nested function.**
**We have/get a closure in Python when a nested function references a value of its enclosing function and then the enclosing function returns the nested function.**
```python
def get_multiplier(a):
@ -2622,7 +2621,7 @@ Line # Hits Time Per Hit % Time Line Contents
@ -693,18 +693,15 @@ player = Player(point, direction) <span class="hljs-comment">#
<li><strong>Package is a collection of modules, but it can also define its own objects.</strong></li>
<li><strong>On a filesystem this corresponds to a directory of Python files with an optional init script.</strong></li>
<li><strong>Running <codeclass="python hljs"><spanclass="hljs-string">'import <package>'</span></code> does not automatically provide access to the package's modules unless they are explicitly imported in its init script.</strong></li>
<li><strong>Imports are relative to the location of file that was passed to python command, but can be made relative to their own location with <codeclass="python hljs"><spanclass="hljs-string">'from .[…][<file>[.…]] import <obj>'</span></code>.</strong></li>
</ul>
<div><h2id="closure"><ahref="#closure"name="closure">#</a>Closure</h2><p><strong>We have/get a closure in Python when:</strong></p><ul>
<li><strong>A nested function references a value of its enclosing function and then</strong></li>
<li><strong>the enclosing function returns the nested function.</strong></li>
<div><h2id="closure"><ahref="#closure"name="closure">#</a>Closure</h2><p><strong>We have/get a closure in Python when a nested function references a value of its enclosing function and then the enclosing function returns the nested function.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-function"><spanclass="hljs-keyword">def</span><spanclass="hljs-title">get_multiplier</span><spanclass="hljs-params">(a)</span>:</span>
<div><h3id="samplingandmemoryprofilers">Sampling and Memory Profilers</h3><pre><codeclass="text language-text">┏━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━┓
┃ pip3 install │ Type │ Target │ How to run │ Live ┃
<div><h3id="samplingandmemoryprofilers">Sampling and Memory Profilers</h3><pre><codeclass="text language-text">┏━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━┯━━━━━━┓
┃ pip3 install │ Target │ How to run │ Lines │ Live ┃
<div><h2id="numpy"><ahref="#numpy"name="numpy">#</a>NumPy</h2><p><strong>Array manipulation mini-language. It can run up to one hundred times faster than the equivalent Python code. An even faster alternative that runs on a GPU is called CuPy.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-comment"># $ pip3 install numpy</span>