Jim Jewett schrieb: > On 8/7/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > >> If b"..." is immutable, the >> immutable bytes type is in your face all the time and you'll have to >> deal with the difference all the time. > > There is a conceptual difference between the main use cases for > mutable (a buffer) and the main use cases for immutable (a protocol > constant). > > I'm not sure why you would need a literal for the mutable version. > How often do you create a new buffer with initial values? (Note: not > pointing to existing memory; creating a new one.)
The same reason that you might create empty lists or dicts: to fill them. >> E.g. is the result of >> concatenating a mutable and an immutable bytes object mutable? >> Does it matter whether the mutable operand is first or second? > > I would say immutable; you're taking a snapshot. (I would have some > sympathy for taking the type of the first operand, but then you need > to worry about + vs +=, and whether the start of the new object will > notice later state changes.) But what about mutable = mutable + immutable mutable += immutable I'd expect it to stay mutable in both cases. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
