[docs] [issue13538] Docstring of str() and/or behavior

Antoine Pitrou report at bugs.python.org
Tue Dec 6 14:14:32 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> Personally I'm not at all sure why str takes encoding and errors
> arguments (I never use them).

Probably because the unicode type also did in 2.x.
And also because it makes it compatible with arbitrary buffer objects:

>>> str(memoryview(b"foo"), "ascii")
'foo'

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13538>
_______________________________________


More information about the docs mailing list