[Python-3000] Immutable bytes type and dbm modules
Nick Coghlan
ncoghlan at gmail.com
Mon Aug 6 13:11:33 CEST 2007
Martin v. Löwis wrote:
> I don't think it needs to be a separate type,
> instead, bytes objects could have a idem-potent
> .freeze() method which switches the "immutable"
> bit on. There would be no way to switch it off
> again.
+1 here - hashable byte sequences are very handy for dealing with
fragments of low level serial protocols.
It would also be nice if b"" literals set that immutable flag
automatically - otherwise converting some of my lookup tables over to
Py3k would be a serious pain (not a pain I'm likely to have to deal with
personally given the relative time frames involved, but a pain nonetheless).
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-3000
mailing list