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 = ['a', 'b', 'c']
> >     lst.append('d') # raises an error?
>
> 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 components, unlike a
>  literal).
>
> So if bytes are mutable and also have source-level
> representation, they should be displays, not literals.

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?

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy
_______________________________________________
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

Reply via email to