Fix another paragraph that was referring to bytes()==str() raising TypeError.

This commit is contained in:
Guido van Rossum 2007-10-01 02:58:22 +00:00
parent e2096897b5
commit ded68a78fc
1 changed files with 4 additions and 5 deletions

View File

@ -234,12 +234,11 @@ Bytes and the Str Type
----------------------
Like the bytes type in Python 3.0a1, and unlike the relationship
between str and unicode in Python 2.x, any attempt to mix bytes (or
between str and unicode in Python 2.x, attempts to mix bytes (or
buffer) objects and str objects without specifying an encoding will
raise a TypeError exception. This is the case even for simply
comparing a bytes or buffer object to a str object (even violating the
general rule that comparing objects of different types for equality
should just return False).
raise a TypeError exception. (However, comparing bytes/buffer and str
objects for equality will simply return False; see the section on
Comparisons above.)
Conversions between bytes or buffer objects and str objects must
always be explicit, using an encoding. There are two equivalent APIs: