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

Bob Ippolito bob at redivi.com
Sun Mar 4 02:06:39 CET 2007


On 3/3/07, Daniel Stutzbach <daniel at stutzbachenterprises.com> wrote:
> 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"

That's exactly what Guido said and what I was agreeing with. With use cases.

-bob


More information about the Python-3000 mailing list