[Python-3000] Immutable bytes type and dbm modules

Nick Coghlan ncoghlan at gmail.com
Tue Aug 7 18:22:51 CEST 2007


Guido van Rossum wrote:
> On 8/7/07, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> A separate frozenbytes type (with the bytes API instead of the
>> string API) would solve the problem far more cleanly.
> 
> But at a cost: an extra data type, more code to maintain, more docs
> to write, thicker books, etc.
> 
> To me, the most important cost is that every time you need to use 
> bytes you would have to think about whether to use frozen or mutable 
> bytes.

I agree this cost exists, but I don't think it is very high. I would 
expect the situation to be the same as with sets - you'd use the mutable
version by default, unless there was some specific reason to want the 
frozen version (usually because you want something that is hashable, or 
easy to share safely amongst multiple clients).

However, code also talks louder than words in this case, and I don't 
have any relevant code, so I am going to try to stay out of this thread now.

Cheers,
Nick.


-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list