mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
typo "an bytes object" --> "a bytes object "
This commit is contained in:
+1
-1
@@ -338,7 +338,7 @@ TypeError: 'bytes' object does not support item assignment</samp></pre>
|
||||
<samp class=p>>>> </samp><kbd class=pp>barr</kbd>
|
||||
<samp class=pp>bytearray(b'fbcde')</samp></pre>
|
||||
<ol>
|
||||
<li>To convert an <code>bytes</code> object into a mutable <code>bytearray</code> object, use the built-in <code>bytearray()</code> function.
|
||||
<li>To convert a <code>bytes</code> object into a mutable <code>bytearray</code> object, use the built-in <code>bytearray()</code> function.
|
||||
<li>All the methods and operations you can do on a <code>bytes</code> object, you can do on a <code>bytearray</code> object too.
|
||||
<li>The one difference is that, with the <code>bytearray</code> object, you can assign individual bytes using index notation. The assigned value must be an integer between 0–255.
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user