[Python-3000] Unicode and OS strings (original) (raw)

Gregory P. Smith greg at krypto.org
Sun Sep 16 21:14:03 CEST 2007


On 9/16/07, Paul Moore <p.f.moore at gmail.com> wrote:

On 16/09/2007, Fred Drake <fdrake at acm.org> wrote: > On Sep 15, 2007, at 10:00 PM, Nicholas Bastin wrote: > > Then lets stop beating around the bush and implement an immutable > > bytes type. Why put ourselves through contortions trying to jam a > > square peg into a round hole and not just decide to make a round peg? > > +42 !!!!

I knew this would come up again when I made that comment - I deliberately didn't express an opinion then, as I didn't want to obscure the point. But I'll come off the fence and admit that I'm also in favour of an immutable bytes type (and for bytes literals to be of that type). Paul.

FYI - my first patch in the bytes object support for PyBUF_LOCKDATA thread added support for immutable bytes. I didn't add a hash method yet but that should be trivial.

Should the hash method raise an exception when set_immutable has not been called yet or should it call set_immutable? I'm in favor of the exception. side effects are bad.

-gps



More information about the Python-3000 mailing list