Message173023
+ 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,
and/or
+ (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:25 | ezio.melotti | set | recipients:
+ ezio.melotti, terry.reedy, pitrou, eric.araujo, r.david.murray, chris.jerdonek, docs@python, Guillaume.Bouchard |
2012-10-16 09:58:25 | ezio.melotti | set | messageid: <1350381505.77.0.900699605011.issue13538@psf.upfronthosting.co.za> |
2012-10-16 09:58:25 | ezio.melotti | link | issue13538 messages |
2012-10-16 09:58:25 | ezio.melotti | create | |
|