[docs] [issue13538] Improve doc for str(bytesobject)

Chris Jerdonek report at bugs.python.org
Mon Oct 15 19:27:03 CEST 2012

Chris Jerdonek added the comment:

> I would just say that str(bytesobj, encoding, errors) is equivalent to bytesobj.decode(encoding, errors) (assuming it really is).

Good suggestion.  And yes, code is shared in the following way:


One thing that would need to be addressed in the str() version is if bytesobj is a PEP 3118 character buffer, after which it falls back to bytesobj.decode(encoding, errors).  I will update the patch so people can see how it looks.


Python tracker <report at bugs.python.org>

More information about the docs mailing list