[Python-3000] Immutable bytes type and dbm modules
Greg Ewing
greg.ewing at canterbury.ac.nz
Tue Aug 7 03:30:29 CEST 2007
Guido van Rossum wrote:
> The frozenbytes type is intended (if I
> understand the use case correctly) as for the relatively rare case
> where bytes must be used as dict keys
Another issue I can see is that not having a frozen
bytes literal means that there is no efficient way of
embedding constant bytes data in a program. You
end up with extra overhead in both time and space
(two copies of the data in memory, and extra time
needed to make the copy).
If the literal form is frozen, on the other hand,
you only incur these overheads when you really need
a mutable copy of the data.
--
Greg
More information about the Python-3000
mailing list