Browse Source

Exceptions, Print, Open

pull/187/head
Jure Šorn 10 months ago
parent
commit
dae03ded70
3 changed files with 7 additions and 7 deletions
  1. 6
      README.md
  2. 6
      index.html
  3. 2
      parse.js

6
README.md

@ -1452,7 +1452,7 @@ BaseException
+-- LookupError # Base class for errors when a collection can't find an item. +-- LookupError # Base class for errors when a collection can't find an item.
| +-- IndexError # Raised when a sequence index is out of range. | +-- IndexError # Raised when a sequence index is out of range.
| +-- KeyError # Raised when a dictionary key or set element is missing. | +-- KeyError # Raised when a dictionary key or set element is missing.
+-- MemoryError # Out of memory. Could be too late to start deleting vars.
+-- MemoryError # Out of memory. May be too late to start deleting objects.
+-- NameError # Raised when nonexistent name (variable/func/class) is used. +-- NameError # Raised when nonexistent name (variable/func/class) is used.
| +-- UnboundLocalError # Raised when local name is used before it's being defined. | +-- UnboundLocalError # Raised when local name is used before it's being defined.
+-- OSError # Errors such as FileExistsError/TimeoutError (see #Open). +-- OSError # Errors such as FileExistsError/TimeoutError (see #Open).
@ -1515,7 +1515,7 @@ print(<el_1>, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
from pprint import pprint from pprint import pprint
pprint(<collection>, width=80, depth=None, compact=False, sort_dicts=True) pprint(<collection>, width=80, depth=None, compact=False, sort_dicts=True)
``` ```
* **Each item is printed on its own line if collection takes up more than 'width' characters.**
* **Each item is printed on its own line if collection exceeds 'width' characters.**
* **Nested collections that are 'depth' levels deep get printed as '...'.** * **Nested collections that are 'depth' levels deep get printed as '...'.**
@ -1601,7 +1601,7 @@ Open
<file>.write(<str/bytes>) # Writes a string or bytes object. <file>.write(<str/bytes>) # Writes a string or bytes object.
<file>.writelines(<collection>) # Writes a coll. of strings or bytes objects. <file>.writelines(<collection>) # Writes a coll. of strings or bytes objects.
<file>.flush() # Flushes write buffer. Runs every 4096/8192 B. <file>.flush() # Flushes write buffer. Runs every 4096/8192 B.
<file>.close() # Closes the file after flushing.
<file>.close() # Closes the file after flushing write buffer.
``` ```
* **Methods do not add or strip trailing newlines, not even writelines().** * **Methods do not add or strip trailing newlines, not even writelines().**

6
index.html

@ -1237,7 +1237,7 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
├── LookupError <span class="hljs-comment"># Base class for errors when a collection can't find an item.</span> ├── LookupError <span class="hljs-comment"># Base class for errors when a collection can't find an item.</span>
│ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span> │ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
│ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is missing.</span> │ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is missing.</span>
├── MemoryError <span class="hljs-comment"># Out of memory. Could be too late to start deleting vars.</span>
├── MemoryError <span class="hljs-comment"># Out of memory. May be too late to start deleting objects.</span>
├── NameError <span class="hljs-comment"># Raised when nonexistent name (variable/func/class) is used.</span> ├── NameError <span class="hljs-comment"># Raised when nonexistent name (variable/func/class) is used.</span>
│ └── UnboundLocalError <span class="hljs-comment"># Raised when local name is used before it's being defined.</span> │ └── UnboundLocalError <span class="hljs-comment"># Raised when local name is used before it's being defined.</span>
├── OSError <span class="hljs-comment"># Errors such as FileExistsError/TimeoutError (see #Open).</span> ├── OSError <span class="hljs-comment"># Errors such as FileExistsError/TimeoutError (see #Open).</span>
@ -1288,7 +1288,7 @@ pprint(&lt;collection&gt;, width=<span class="hljs-number">80</span>, depth=<spa
</code></pre></div> </code></pre></div>
<ul> <ul>
<li><strong>Each item is printed on its own line if collection takes up more than 'width' characters.</strong></li>
<li><strong>Each item is printed on its own line if collection exceeds 'width' characters.</strong></li>
<li><strong>Nested collections that are 'depth' levels deep get printed as '…'.</strong></li> <li><strong>Nested collections that are 'depth' levels deep get printed as '…'.</strong></li>
</ul> </ul>
<div><h2 id="input"><a href="#input" name="input">#</a>Input</h2><pre><code class="python language-python hljs">&lt;str&gt; = input(prompt=<span class="hljs-keyword">None</span>) <div><h2 id="input"><a href="#input" name="input">#</a>Input</h2><pre><code class="python language-python hljs">&lt;str&gt; = input(prompt=<span class="hljs-keyword">None</span>)
@ -1361,7 +1361,7 @@ p.add_argument(<span class="hljs-string">'&lt;name&gt;'</span>, type=&lt;type&gt
<pre><code class="python language-python hljs">&lt;file&gt;.write(&lt;str/bytes&gt;) <span class="hljs-comment"># Writes a string or bytes object.</span> <pre><code class="python language-python hljs">&lt;file&gt;.write(&lt;str/bytes&gt;) <span class="hljs-comment"># Writes a string or bytes object.</span>
&lt;file&gt;.writelines(&lt;collection&gt;) <span class="hljs-comment"># Writes a coll. of strings or bytes objects.</span> &lt;file&gt;.writelines(&lt;collection&gt;) <span class="hljs-comment"># Writes a coll. of strings or bytes objects.</span>
&lt;file&gt;.flush() <span class="hljs-comment"># Flushes write buffer. Runs every 4096/8192 B.</span> &lt;file&gt;.flush() <span class="hljs-comment"># Flushes write buffer. Runs every 4096/8192 B.</span>
&lt;file&gt;.close() <span class="hljs-comment"># Closes the file after flushing.</span>
&lt;file&gt;.close() <span class="hljs-comment"># Closes the file after flushing write buffer.</span>
</code></pre> </code></pre>
<ul> <ul>
<li><strong>Methods do not add or strip trailing newlines, not even writelines().</strong></li> <li><strong>Methods do not add or strip trailing newlines, not even writelines().</strong></li>

2
parse.js

@ -427,7 +427,7 @@ const DIAGRAM_7_B =
" ├── LookupError <span class='hljs-comment'># Base class for errors when a collection can't find an item.</span>\n" + " ├── LookupError <span class='hljs-comment'># Base class for errors when a collection can't find an item.</span>\n" +
" │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" + " │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" +
" │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is missing.</span>\n" + " │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is missing.</span>\n" +
" ├── MemoryError <span class='hljs-comment'># Out of memory. Could be too late to start deleting vars.</span>\n" +
" ├── MemoryError <span class='hljs-comment'># Out of memory. May be too late to start deleting objects.</span>\n" +
" ├── NameError <span class='hljs-comment'># Raised when nonexistent name (variable/func/class) is used.</span>\n" + " ├── NameError <span class='hljs-comment'># Raised when nonexistent name (variable/func/class) is used.</span>\n" +
" │ └── UnboundLocalError <span class='hljs-comment'># Raised when local name is used before it's being defined.</span>\n" + " │ └── UnboundLocalError <span class='hljs-comment'># Raised when local name is used before it's being defined.</span>\n" +
" ├── OSError <span class='hljs-comment'># Errors such as FileExistsError/TimeoutError (see #Open).</span>\n" + " ├── OSError <span class='hljs-comment'># Errors such as FileExistsError/TimeoutError (see #Open).</span>\n" +

Loading…
Cancel
Save