擅长:python、mysql、java
<p>这就是它的设计方式——这是有意义的,因为通常,您会对iterable而不是单个整数调用<code>bytes</code>:</p>
<pre><code>>>> bytes([3])
b'\x03'
</code></pre>
<p><a href="http://docs.python.org/3.3/library/stdtypes.html#binaryseq">docs state this</a>以及<code>bytes</code>的docstring:</p>
<pre><code> >>> help(bytes)
...
bytes(int) -> bytes object of size given by the parameter initialized with null bytes
</code></pre>