[issue8047] Serialiser in ElementTree returns unicode strings in Py3k

Fredrik Lundh report at bugs.python.org
Fri Mar 12 11:25:34 CET 2010


Fredrik Lundh <fredrik at effbot.org> added the comment:

"I wouldn't raise much opposition against tobytes() as an alias for tostring(), although that sounds more like duplicating an otherwise simple API."

Adding an alias would be a way address the 2.X/3.X terminology overlap; string traditionally implies 8-bit in 2.X, and apparently now Unicode in 3.X.  That's likely to cause a lot of confusion for people switching from 2 to 3 (and to people writing 3.X documentation, apparently; the array module's documentation is an example of that).

(And once everyone has switched over, we can deprecate the tostring spelling... :)

ET isn't the only thing with tostring functionality, of course -- it's  pretty much the standard name for "serialize data structure to byte string for later transmission" -- so it probably wouldn't hurt with a python-dev pronouncement here.

----------

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


More information about the Python-bugs-list mailing list