<pre><codeclass="python language-python hljs">value = <dict>.get(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Returns default if key is missing.</span>
value = <dict>.setdefault(key, default=<spanclass="hljs-keyword">None</span>) <spanclass="hljs-comment"># Returns and writes default if key is missing.</span>
<dict> = collections.defaultdict(<type>) <spanclass="hljs-comment"># Creates a dict with default value of type.</span>
<dict> = collections.defaultdict(<spanclass="hljs-keyword">lambda</span>: <spanclass="hljs-number">1</span>) <spanclass="hljs-comment"># Creates a dict with default value 1.</span>
<dict> = collections.defaultdict(<type>) <spanclass="hljs-comment"># Returns a dict with default value of type.</span>
<dict> = collections.defaultdict(<spanclass="hljs-keyword">lambda</span>: <spanclass="hljs-number">1</span>) <spanclass="hljs-comment"># Returns a dict with default value 1.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><dict> = dict(<collection>) <spanclass="hljs-comment"># Creates a dict from coll. of key-value pairs.</span>
<dict> = dict(zip(keys, values)) <spanclass="hljs-comment"># Creates a dict from two collections.</span>
<div><h3id="decode-2">Decode</h3><pre><codeclass="python language-python hljs"><bytes> = bytes(<mview>) <spanclass="hljs-comment"># Creates a new bytes object.</span>
<div><h3id="decode-2">Decode</h3><pre><codeclass="python language-python hljs"><bytes> = bytes(<mview>) <spanclass="hljs-comment"># Returns a new bytes object.</span>
<bytes> = <bytes>.join(<coll_of_mviews>) <spanclass="hljs-comment"># Joins mviews using bytes object as sep.</span>
<array> = array(<spanclass="hljs-string">'<typecode>'</span>, <mview>) <spanclass="hljs-comment"># Treats mview as a sequence of numbers.</span>
<file>.write(<mview>) <spanclass="hljs-comment"># Writes mview to the binary file.</span>