They accept .replace(b"00", b"12") for example. <a href="http://docs.python.org/py3k/library/stdtypes.html#bytes-methods">Documentation about it.</a><br><br><div class="gmail_quote">2011/5/17 Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">In Python 3 one can say<br>
<br>
--> huh = bytes(5)<br>
<br>
Since the bytes type is actually a list of integers, I would have expected this to have huh being a bytestring with one element -- the integer 5.  Actually, what you get is:<br>
<br>
--> huh<br>
b'\x00\x00\x00\x00\x00'<br>
<br>
or five null bytes.  Note that this is an immutable type, so you cannot go in later and say<br>
<br>
--> huh[3] = 9<br>
Traceback (most recent call last):<br>
  File "<stdin>", line 1, in <module><br>
TypeError: 'bytes' object does not support item assignment<br>
<br>
<br>
So, out of curiosity, does anyone actually use this, um, feature?<br>
<br>
~Ethan~<br><font color="#888888">
-- <br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Felipe Bastos Nunes<br>