[Python-3000] Immutable bytes type and dbm modules
greg.ewing at canterbury.ac.nz
Wed Aug 8 12:57:24 CEST 2007
Adam Olsen wrote:
> Less confusing to prohibit concatenation of mismatched types. There's
> always trivial workarounds (ie () + tuple() or .extend()).
Normally I would agree, but in this case I feel that
it would be inconvenient. With the scheme I proposed,
code that treats bytes as read-only doesn't have to
care whether it has a mutable or immutable object.
If they were as rigidly separated as lists and tuples,
every API would have to be strictly aware of whether
it dealt with mutable or immutable bytes.
I could be wrong, though. It may turn out that keeping
them separate is the right thing to do.
More information about the Python-3000