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 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 buffer) objects and str objects without specifying an encoding will
raise a TypeError exception. This is the case even for simply raise a TypeError exception. (However, comparing bytes/buffer and str
comparing a bytes or buffer object to a str object (even violating the objects for equality will simply return False; see the section on
general rule that comparing objects of different types for equality Comparisons above.)
should just return False).
Conversions between bytes or buffer objects and str objects must Conversions between bytes or buffer objects and str objects must
always be explicit, using an encoding. There are two equivalent APIs: always be explicit, using an encoding. There are two equivalent APIs: