Skip to content

Commit 152715f

Browse files
committed
Array
1 parent 9e387f5 commit 152715f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,11 +1931,13 @@ b'\x00\x01\x00\x02\x00\x00\x00\x03'
19311931

19321932
Array
19331933
-----
1934-
**List that can only hold numbers of predefined type. Available types and their sizes in bytes are listed above.**
1934+
**List that can only hold numbers of a predefined type. Available types and their sizes in bytes are listed above.**
19351935

19361936
```python
19371937
from array import array
1938-
<array> = array('<typecode>' [, <collection>])
1938+
<array> = array('<typecode>', <collection>) # Array from collection of numbers.
1939+
<array> = array('<typecode>', <bytes>) # Array from bytes object.
1940+
<bytes> = <array>.tobytes()
19391941
```
19401942

19411943

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,8 +1717,10 @@
17171717

17181718

17191719

1720-
<div><h2 id="array"><a href="#array" name="array">#</a>Array</h2><p><strong>List that can only hold numbers of predefined type. Available types and their sizes in bytes are listed above.</strong></p><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> array <span class="hljs-keyword">import</span> array
1721-
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span> [, &lt;collection&gt;])
1720+
<div><h2 id="array"><a href="#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><code class="python language-python hljs"><span class="hljs-keyword">from</span> array <span class="hljs-keyword">import</span> array
1721+
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;collection&gt;) <span class="hljs-comment"># Array from collection of numbers.</span>
1722+
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;bytes&gt;) <span class="hljs-comment"># Array from bytes object.</span>
1723+
&lt;bytes&gt; = &lt;array&gt;.tobytes()
17221724
</code></pre></div>
17231725

17241726

0 commit comments

Comments
 (0)