Author: guido.van.rossum Date: Thu Sep 27 16:24:32 2007 New Revision: 58273 Modified: peps/trunk/pep-3137.txt Log: Fixed encode()/decode() turn-around. Modified: peps/trunk/pep-3137.txt ============================================================================== --- peps/trunk/pep-3137.txt (original) +++ peps/trunk/pep-3137.txt Thu Sep 27 16:24:32 2007 @@ -230,9 +230,9 @@ Conversions between bytes or buffer objects and str objects must always be explicit, using an encoding. There are two equivalent APIs: ``str(b, <encoding>[, <errors>])`` is equivalent to -``b.encode(<encoding>[, <errors>])``, and +``b.decode(<encoding>[, <errors>])``, and ``bytes(s, <encoding>[, <errors>])`` is equivalent to -``s.decode(<encoding>[, <errors>])``. +``s.encode(<encoding>[, <errors>])``. There is one exception: we can convert from bytes (or buffer) to str without specifying an encoding by writing ``str(b)``. This produces
participants (1)
-
guido.van.rossum