Skip to content

Commit 0e0b5f5

Browse files
committed
Print
1 parent 9ef3e6f commit 0e0b5f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ class Counter:
11521152

11531153
### Callable
11541154
* **All functions and classes have a call() method, hence are callable.**
1155-
* **When this cheatsheet uses `'<function>'` for an argument, it actually means `'<callable>'`.**
1155+
* **When this cheatsheet uses `'<function>'` as an argument, it actually means `'<callable>'`.**
11561156
```python
11571157
class Counter:
11581158
def __init__(self):
@@ -1465,21 +1465,21 @@ Print
14651465
```python
14661466
print(<el_1>, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
14671467
```
1468-
14691468
* **Use `'file=sys.stderr'` for messages about errors.**
14701469
* **Use `'flush=True'` to forcibly flush the stream.**
14711470

14721471
### Pretty Print
14731472
```python
14741473
from pprint import pprint
1475-
pprint(<collection>, width=80, depth=None)
1474+
pprint(<collection>, width=80, depth=None, compact=False, sort_dicts=True)
14761475
```
14771476
* **Levels deeper than 'depth' get replaced by '...'.**
14781477

14791478

14801479
Input
14811480
-----
14821481
**Reads a line from user input or pipe if present.**
1482+
14831483
```python
14841484
<str> = input(prompt=None)
14851485
```

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@
10961096
<li><strong>File objects returned by the <a href="#open">open()</a> function, etc.</strong></li>
10971097
</ul><div><h3 id="callable">Callable</h3><ul>
10981098
<li><strong>All functions and classes have a call() method, hence are callable.</strong></li>
1099-
<li><strong>When this cheatsheet uses <code class="python hljs"><span class="hljs-string">'&lt;function&gt;'</span></code> for an argument, it actually means <code class="python hljs"><span class="hljs-string">'&lt;callable&gt;'</span></code>.</strong></li>
1099+
<li><strong>When this cheatsheet uses <code class="python hljs"><span class="hljs-string">'&lt;function&gt;'</span></code> as an argument, it actually means <code class="python hljs"><span class="hljs-string">'&lt;callable&gt;'</span></code>.</strong></li>
11001100
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Counter</span>:</span>
11011101
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self)</span>:</span>
11021102
self.i = <span class="hljs-number">0</span>
@@ -1369,7 +1369,7 @@
13691369
<li><strong>Use <code class="python hljs"><span class="hljs-string">'flush=True'</span></code> to forcibly flush the stream.</strong></li>
13701370
</ul>
13711371
<div><h3 id="prettyprint">Pretty Print</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> pprint <span class="hljs-keyword">import</span> pprint
1372-
pprint(&lt;collection&gt;, width=<span class="hljs-number">80</span>, depth=<span class="hljs-keyword">None</span>)
1372+
pprint(&lt;collection&gt;, width=<span class="hljs-number">80</span>, depth=<span class="hljs-keyword">None</span>, compact=<span class="hljs-keyword">False</span>, sort_dicts=<span class="hljs-keyword">True</span>)
13731373
</code></pre></div>
13741374

13751375
<ul>

0 commit comments

Comments
 (0)