On Sat, Feb 9, 2013 at 10:10 PM, Peter Otten <__pete...@web.de> wrote: > """Return the hexadecimal representation of the binary data. Every byte of > data is converted into the corresponding 2-digit hex representation. > """ > > makes it pretty clear that the function is operating on bytes, not str.
That doesn't necessarily mean it has to return bytes, though. It's taking binary data and producing something that's plausibly either bytes or str. It's human-readable and would definitely make sense to be str (for instance, hex() returns a str), so imo this should be made very clear in the docs. Maybe: """Return the hexadecimal representation of the binary data. Every byte of data is converted into two bytes with the corresponding hex representation in ASCII. """ or somesuch? ChrisA -- http://mail.python.org/mailman/listinfo/python-list