Author ezio.melotti
Recipients Guillaume.Bouchard, chris.jerdonek, docs@python, eric.araujo, ezio.melotti, pitrou, r.david.murray, terry.reedy
Date 2012-10-16.09:58:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
+              str(bytes, encoding[, errors='strict'])
+              str(bytes, errors[, encoding='utf-8'])

Why not simply str(bytes, encoding='utf-8', errors='strict')? (Your signature suggests that str(b'abc', 'strict') should work.)

+   the string itself.  This behavior differs from :func:`repr` in that the

I'm not sure this is the right place where to explain the differences between __str__ and __repr__ (or maybe it is?).  Also doesn't str() falls back on __repr__ if __str__ is missing?  Does :meth:`__str__` link to object.__str__?

+   If *encoding* or *errors* is given,


+   (or :class:`bytearray`) object, then :func:`str` calls

I would use 'is equivalent to', rather than 'calls'.

+   :meth:`bytes.decode(encoding, errors) <bytes.decode>` on the object
+   and returns the value.  Otherwise, the bytes object underlying the buffer
+   object is obtained before calling :meth:`bytes.decode() <bytes.decode>`.

:meth:`bytes.decode` should be enough.

+   Passing a :func:`bytes <bytes>`

:func:`bytes` should be enough (if it isn't, maybe you want :func:`.bytes`).
Date User Action Args
2012-10-16 09:58:25ezio.melottisetrecipients: + ezio.melotti, terry.reedy, pitrou, eric.araujo, r.david.murray, chris.jerdonek, docs@python, Guillaume.Bouchard
2012-10-16 09:58:25ezio.melottisetmessageid: <>
2012-10-16 09:58:25ezio.melottilinkissue13538 messages
2012-10-16 09:58:25ezio.melotticreate