* **Only required methods are iter() and len(). Len() should return the number of items.**
* **This cheatsheet actually means `'<iterable>'` when it uses `'<collection>'`.**
* **This cheatsheet actually means `'<iterable>'` when it uses `'<collection>'`.**
* **I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'. The only drawback of this decision is that a reader could think a certain function doesn't accept iterators when it does, since iterators are the only built-in objects that are iterable but are not collections.**
* **I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'. The only drawback of this decision is that a reader could think a certain function doesn't accept iterators when it does, since iterators are the only built-in objects that are iterable but are not collections.**
```python
```python
@ -1779,8 +1779,8 @@ Pickle
```python
```python
import pickle
import pickle
<bytes> = pickle.dumps(<object>) # Converts object to bytes.
<object> = pickle.loads(<bytes>) # Converts bytes to object.
<bytes> = pickle.dumps(<object>) # Converts object to bytes object.
<object> = pickle.loads(<bytes>) # Converts bytes object to object.
<li><strong>Only required methods are iter() and len().</strong></li>
<li><strong>Only required methods are iter() and len(). Len() should return the number of items.</strong></li>
<li><strong>This cheatsheet actually means <codeclass="python hljs"><spanclass="hljs-string">'<iterable>'</span></code> when it uses <codeclass="python hljs"><spanclass="hljs-string">'<collection>'</span></code>.</strong></li>
<li><strong>This cheatsheet actually means <codeclass="python hljs"><spanclass="hljs-string">'<iterable>'</span></code> when it uses <codeclass="python hljs"><spanclass="hljs-string">'<collection>'</span></code>.</strong></li>
<li><strong>I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'. The only drawback of this decision is that a reader could think a certain function doesn't accept iterators when it does, since iterators are the only built-in objects that are iterable but are not collections.</strong></li>
<li><strong>I chose not to use the name 'iterable' because it sounds scarier and more vague than 'collection'. The only drawback of this decision is that a reader could think a certain function doesn't accept iterators when it does, since iterators are the only built-in objects that are iterable but are not collections.</strong></li>
<div><h2id="pickle"><ahref="#pickle"name="pickle">#</a>Pickle</h2><p><strong>Binary file format for storing Python objects.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> pickle
<div><h2id="pickle"><ahref="#pickle"name="pickle">#</a>Pickle</h2><p><strong>Binary file format for storing Python objects.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> pickle
<bytes> = pickle.dumps(<object>) <spanclass="hljs-comment"># Converts object to bytes.</span>
<object> = pickle.loads(<bytes>) <spanclass="hljs-comment"># Converts bytes to object.</span>
<bytes> = pickle.dumps(<object>) <spanclass="hljs-comment"># Converts object to bytes object.</span>
<object> = pickle.loads(<bytes>) <spanclass="hljs-comment"># Converts bytes object to object.</span>