* **For details about sort(), sorted(), min() and max() see [sortable](#sortable).**
* **For details about sort(), sorted(), min() and max() see [Sortable](#sortable).**
* **Module [operator](#operator) has function itemgetter() that can replace listed [lambdas](#lambda).**
* **This text uses the term 'collection' instead of 'iterable'. For rationale see [collection](#collection).**
* **This text uses the term collection instead of iterable. For rationale see [Collection](#collection).**
```python
<int> = len(<list>) # Returns number of items. Also works on dict, set and string.
@ -1420,7 +1420,7 @@ except (<exception>, [...]) as <name>: ...
* **Also catches subclasses of the exception.**
* **Use `'traceback.print_exc()'` to print the full error message to stderr.**
* **Use `'print(<name>)'` to print just the cause of the exception (its arguments).**
* **Use `'logging.exception(<str>)'` to log the passed message, followed by the full error message of the caught exception. For details see [logging](#logging).**
* **Use `'logging.exception(<str>)'` to log the passed message, followed by the full error message of the caught exception. For details see [Logging](#logging).**
* **Use `'sys.exc_info()'` to get exception type, object, and traceback of caught exception.**
<li><strong>For details about sort(), sorted(), min() and max() see <ahref="#sortable">sortable</a>.</strong></li>
<li><strong>For details about sort(), sorted(), min() and max() see <ahref="#sortable">Sortable</a>.</strong></li>
<li><strong>Module <ahref="#operator">operator</a> has function itemgetter() that can replace listed <ahref="#lambda">lambdas</a>.</strong></li>
<li><strong>This text uses the term 'collection' instead of 'iterable'. For rationale see <ahref="#collection">collection</a>.</strong></li>
<li><strong>This text uses the term collection instead of iterable. For rationale see <ahref="#collection">Collection</a>.</strong></li>
</ul>
<pre><codeclass="python language-python hljs"><int> = len(<list>) <spanclass="hljs-comment"># Returns number of items. Also works on dict, set and string.</span>
<int> = <list>.count(<el>) <spanclass="hljs-comment"># Returns number of occurrences. Also `if <el> in <coll>: ...`.</span>
<li><strong>Also catches subclasses of the exception.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'traceback.print_exc()'</span></code> to print the full error message to stderr.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'print(<name>)'</span></code> to print just the cause of the exception (its arguments).</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'logging.exception(<str>)'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see <ahref="#logging">logging</a>.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'logging.exception(<str>)'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see <ahref="#logging">Logging</a>.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'sys.exc_info()'</span></code> to get exception type, object, and traceback of caught exception.</strong></li>
'<strong>For details about sort(), sorted(), min() and max() see <a href="#sortable">sortable</a>.</strong>':'<strong>For details about sort(), sorted(), min() and max() see sortable (p. 16).</strong>',
'<strong>For details about sort(), sorted(), min() and max() see <a href="#sortable">Sortable</a>.</strong>':'<strong>For details about sort(), sorted(), min() and max() see Sortable (p. 16).</strong>',
'<strong>Module <a href="#operator">operator</a> has function itemgetter() that can replace listed <a href="#lambda">lambdas</a>.</strong>':'<strong>Module \'operator\' (p. 31) has function itemgetter() that can replace listed lambdas (p. 11).</strong>',
'<strong>This text uses the term \'collection\' instead of \'iterable\'. For rationale see <a href="#collection">collection</a>.</strong>':'<strong>This text uses the term \'collection\' instead of \'iterable\'. For rationale see collection (p. 18).</strong>',
'<strong>This text uses the term collection instead of iterable. For rationale see <a href="#collection">Collection</a>.</strong>':'<strong>This text uses the term collection instead of iterable. For rationale see Collection (p. 18).</strong>',
'<strong>Adding <code class="python hljs"><span class="hljs-string">\'!r\'</span></code> to the expression converts object to string by calling its <a href="#class">repr()</a> method.</strong>':'<strong>Adding <code class="python hljs"><span class="hljs-string">\'!r\'</span></code> to the expression converts object to string by calling its repr() method.</strong>',
'<strong>It can be any <a href="#callable">callable</a>, but is usually implemented as a function that returns a <a href="#closure">closure</a>.</strong>':'<strong>It can be any callable, but is usually implemented as a function that returns a closure.</strong>',
'<strong>Hints are used by type checkers like <a href="https://pypi.org/project/mypy/">mypy</a>, data validation libraries such as <a href="https://pypi.org/project/pydantic/">Pydantic</a> and lately also by <a href="https://pypi.org/project/Cython/">Cython</a> compiler. However, they are not enforced by CPython interpreter.</strong>':'<strong>Hints are used by type checkers like mypy, data validation libraries such as Pydantic and lately also by Cython compiler. However, they are not enforced by CPython interpreter.</strong>',
@ -20,7 +20,7 @@ MATCHES = {
'<strong>Objects returned by the <a href="#itertools">itertools</a> module, such as count, repeat and cycle.</strong>':'<strong>Objects returned by the itertools module, such as count, repeat and cycle (p. 3).</strong>',
'<strong>Generators returned by the <a href="#generator">generator functions</a> and <a href="#comprehensions">generator expressions</a>.</strong>':'<strong>Generators returned by the generator functions (p. 4) and generator expressions (p. 11).</strong>',
'<strong>File objects returned by the <a href="#open">open()</a> function, etc.</strong>':'<strong>File objects returned by the open() function (p. 22), etc.</strong>',
'<strong>Use <code class="python hljs"><span class="hljs-string">\'logging.exception(<str>)\'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see <a href="#logging">logging</a>.</strong>':'<strong>Use <code class="python hljs"><span class="hljs-string">\'logging.exception(<str>)\'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see logging (p. 31).</strong>',
'<strong>Use <code class="python hljs"><span class="hljs-string">\'logging.exception(<str>)\'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see <a href="#logging">Logging</a>.</strong>':'<strong>Use <code class="python hljs"><span class="hljs-string">\'logging.exception(<str>)\'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see Logging (p. 31).</strong>',
'<strong>Functions report OS related errors by raising either OSError or one of its <a href="#exceptions-1">subclasses</a>.</strong>':'<strong>Functions report OS related errors by raising OSError or one of its subclasses (p. 23).</strong>',
'<strong>To print the spreadsheet to the console use <a href="#table">Tabulate</a> library.</strong>':'<strong>To print the spreadsheet to the console use Tabulate library (p. 34).</strong>',
'<strong>For XML and binary Excel files (xlsx, xlsm and xlsb) use <a href="#dataframeplotencodedecode">Pandas</a> library.</strong>':'<strong>For XML and binary Excel files (xlsx, xlsm and xlsb) use Pandas library (p. 46).</strong>',