[Python-3000] Immutable bytes type and dbm modules

Georg Brandl g.brandl at gmx.net
Wed Aug 8 08:40:02 CEST 2007


Greg Ewing schrieb:

> So concatenating mutable and immutable should give the
> same result as concatenating two immutables, i.e. an
> immutable. If you need to add something to the end of
> your buffer, while keeping it mutable, you use extend().
> 
> This gives us
> 
>    immutable + immutable -> immutable
>    mutable + immutable -> immutable
>    immutable + mutable -> immutable
>    mutable + mutable -> mutable  (*)

NB: when dealing with sets and frozensets, you get the type of
the first operand.  Doing something different here is confusing.

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.



More information about the Python-3000 mailing list