[Python-3000] Thoughts on new I/O library and bytecode

Daniel Stutzbach daniel at stutzbachenterprises.com
Sun Mar 4 01:59:17 CET 2007


On 3/3/07, Bob Ippolito <bob at redivi.com> wrote:
> When Erlang is printing the "repr" of a list or binary term to the
> shell it first checks to see if every item is printable ASCII integer.
> If so, then it prints as an ASCII string. Otherwise, it prints as a
> list of decimal integers. It doesn't work out well in these kinds of
> situations. If it was printed out as ASCII with hex escapes then it
> would make a lot more sense at a glance.

Perhaps it would be best to make one format the default, but provide a
convenience method on the bytes type for the other format?

repr(b) -> bytes("spam spam spam")'
b.hex() -> "7370616d 20737061 6d207370 616d"

-- 
Daniel Stutzbach, Ph.D.             President, Stutzbach Enterprises LLC


More information about the Python-3000 mailing list