擅长:python、mysql、java
<p>对于Python2:<code>basestring</code>是<code>str</code>和<code>unicode</code>的基类,而<code>types.StringType</code><em>是</em><code>str</code>。如果要检查某个字符串,请使用<code>basestring</code>。如果您想检查某个东西是否是bytestring,请使用<code>str</code>并忘记<code>types</code>。</p>