Skip to content

Commit 82e5338

Browse files
committed
Memory view
1 parent 94a06fa commit 82e5338

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,7 @@ Memory View
20072007
<bin_file>.write(<mview>) # Writes mview to the binary file.
20082008
<bytes> = bytes(<mview>) # Creates a new bytes object.
20092009
<bytes> = <bytes>.join(<coll_of_mviews>) # Joins mviews using bytes object as sep.
2010+
<array> = array('<typecode>', <mview>) # Treats mview as a sequence of numbers.
20102011
<list> = list(<mview>) # Returns list of ints or floats.
20112012
<str> = str(<mview>, 'utf-8') # Treats mview as a bytes object.
20122013
<int> = int.from_bytes(<mview>, byteorder='big/little', signed=False)

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,7 @@
17781778
<div><h3 id="decode-2">Decode</h3><pre><code class="python language-python hljs">&lt;bin_file&gt;.write(&lt;mview&gt;) <span class="hljs-comment"># Writes mview to the binary file.</span>
17791779
&lt;bytes&gt; = bytes(&lt;mview&gt;) <span class="hljs-comment"># Creates a new bytes object.</span>
17801780
&lt;bytes&gt; = &lt;bytes&gt;.join(&lt;coll_of_mviews&gt;) <span class="hljs-comment"># Joins mviews using bytes object as sep.</span>
1781+
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;mview&gt;) <span class="hljs-comment"># Treats mview as a sequence of numbers.</span>
17811782
&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns list of ints or floats.</span>
17821783
&lt;str&gt; = str(&lt;mview&gt;, <span class="hljs-string">'utf-8'</span>) <span class="hljs-comment"># Treats mview as a bytes object.</span>
17831784
&lt;int&gt; = int.from_bytes(&lt;mview&gt;, byteorder=<span class="hljs-string">'big/little'</span>, signed=<span class="hljs-keyword">False</span>)

0 commit comments

Comments
 (0)