Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-07 Thread Nick Coghlan
[EMAIL PROTECTED] wrote: > >> So is having mutable bytes just a matter of calling them "byte > >> displays" instead of "byte literals" or does that also require > >> changing something in the back end? > > Martin> It's certainly also an issue of language semantics (i.e. changes >

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-07 Thread skip
>> So is having mutable bytes just a matter of calling them "byte >> displays" instead of "byte literals" or does that also require >> changing something in the back end? Martin> It's certainly also an issue of language semantics (i.e. changes Martin> to interpreter code). The

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Martin v. Löwis
>> That's not a literal, it's a display. The difference is that >> a literal denotes the same object every time it is executed. >> A display creates a new object every time it is executed. >> (another difference is that a display is a constructed thing >> which may contain runtime-computed compone

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Greg Ewing
Steven Bethard wrote: > Does that mean you want list literals to be immutable too? There are no "list literals" in Python, only expressions that construct lists. You might argue that b"abc" is not a literal either, but an expression that constructs a bytes object. However, it *looks* so much lik

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Steven Bethard
On 5/5/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> In general, I don't think it's a good idea to have literals > >> turn into mutable objects, since literals are normally perceived > >> as being constant. > > > > Does that mean you want list literals to be immutable too? > > > > lst =

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Steve Holden
Steven Bethard wrote: > On 5/5/07, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2007-05-04 19:51, Guido van Rossum wrote: >>> [-python-dev] >>> >>> On 5/4/07, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: On Friday 04 May 2007, M.-A. Lemburg wrote: > I also suggest making all bytes lit

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Martin v. Löwis
>> In general, I don't think it's a good idea to have literals >> turn into mutable objects, since literals are normally perceived >> as being constant. > > Does that mean you want list literals to be immutable too? > > lst = ['a', 'b', 'c'] > lst.append('d') # raises an error? That's no

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread M.-A. Lemburg
On 2007-05-05 18:11, Steven Bethard wrote: > On 5/5/07, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> On 2007-05-04 19:51, Guido van Rossum wrote: >> > [-python-dev] >> > >> > On 5/4/07, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: >> >> On Friday 04 May 2007, M.-A. Lemburg wrote: >> >> > I also su

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread Steven Bethard
On 5/5/07, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2007-05-04 19:51, Guido van Rossum wrote: > > [-python-dev] > > > > On 5/4/07, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > >> On Friday 04 May 2007, M.-A. Lemburg wrote: > >> > I also suggest making all bytes literals immutable to avoid

Re: [Python-Dev] Changing string constants to byte arrays in Py3k

2007-05-05 Thread M.-A. Lemburg
On 2007-05-04 19:51, Guido van Rossum wrote: > [-python-dev] > > On 5/4/07, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: >> On Friday 04 May 2007, M.-A. Lemburg wrote: >> > I also suggest making all bytes literals immutable to avoid running >> > into any issues like the above. >> >> +1 from me.