On Wed, 09 Jun 2010 22:13:28 +0200 "Martin v. Löwis" <mar...@v.loewis.de> wrote: > py> binascii.b2a_base64(b'foo') > b'Zm9v\n' > py> binascii.b2a_hex(b'foo') > b'666f6f' > > Now, I'd admit that "b2a" may be a misnomer (binary -> ASCII), but then > it may not because ASCII actually *also* implies "bytes" (it's an encoding). > > So what would you propose to change: b2a_hex should return a Unicode > string? or this future transform method should return a Unicode string, > whereas the module returns bytes? Something else?
Well, I would propose transform return str whereas b2a_hex returns bytes. But I agree the consistency argument with b2a_hex looks quite strong. (speaking of which, the builtin hex() functions returns str, although it's purpose is slightly different) Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com