</ul></div><div><h4id="integertypesusecapitalletterforunsignedtypestandardsizesareinbrackets">Integer types. Use capital letter for unsigned type. Standard sizes are in brackets:</h4><ul>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'x'</span></code> - pad byte</strong></li>
@ -1734,7 +1734,7 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,
<div><h2id="array"><ahref="#array"name="array">#</a>Array</h2><p><strong>List that can only hold numbers of a predefined type. Available types and their sizes in bytes are listed above.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> array <spanclass="hljs-keyword">import</span> array
<array> = array(<spanclass="hljs-string">'<typecode>'</span>, <collection>) <spanclass="hljs-comment"># Array from coll. of numbers.</span>
<array> = array(<spanclass="hljs-string">'<typecode>'</span>, <bytes>) <spanclass="hljs-comment"># Array from bytes object.</span>
<num> = <mview>[<index>] <spanclass="hljs-comment"># Returns an int or a float.</span>
</ul><pre><codeclass="python language-python hljs"><mview> = memoryview(<bytes/bytearray/array>)<spanclass="hljs-comment"># Immutable if bytes, else mutable.</span>
<real> = <mview>[<index>] <spanclass="hljs-comment"># Returns an int or a float.</span>
<mview> = <mview>[<slice>] <spanclass="hljs-comment"># Mview with rearranged elements.</span>
<mview> = <mview>.cast(<spanclass="hljs-string">'<typecode>'</span>) <spanclass="hljs-comment"># Casts memoryview to the new format.</span>
<bin_file>.write(<mview>) <spanclass="hljs-comment"># Appends mview to the binary file.</span>
<mview>.release() <spanclass="hljs-comment"># Releases the object's memory buffer.</span>
</code></pre></div>
<pre><codeclass="python language-python hljs"><bin_file>.write(<mview>) <spanclass="hljs-comment"># Appends mview to the binary file.</span>
<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"># Creates a new bytes object.</span>
<bytes> = <bytes>.join(<coll_of_mviews>) <spanclass="hljs-comment"># Joins mviews using bytes object as sep.</span>
<list> = list(<mview>) <spanclass="hljs-comment"># Returns list of ints or floats.</span>
<div><h2id="deque"><ahref="#deque"name="deque">#</a>Deque</h2><p><strong>A thread-safe list with efficient appends and pops from either side. Pronounced "deck".</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> collections <spanclass="hljs-keyword">import</span> deque