[Python-3000] Immutable bytes type and dbm modules
Ron Adam
rrr at ronadam.com
Fri Aug 10 00:50:50 CEST 2007
Martin v. Löwis wrote:
> Jason Orendorff schrieb:
>> On 8/7/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>>> My concern is that people need to access existing databases. It's
>>> all fine that the code accessing them breaks, and that they have
>>> to actively port to Py3k. However, telling them that they have to
>>> represent the keys in their dbm disk files in a different manner
>>> might cause a revolt...
>> Too true. Offhand, why not provide hooks for serializing and
>> deserializing keys?
>
> Perhaps YAGNI? We already support pickling values (dbshelve),
> and I added support for encoding/decoding strings as either
> keys or values (though in a limited manner).
>
> In any case, somebody would have to make a specification
> for that, and then somebody would have to provide an
> implementation of it.
>
> Regards,
> Martin
Just a thought...
Would some sort of an indirect reference type help. Possibly an
object_id_based_reference as keys instead of using or hashing the object
itself? This wouldn't change if the object mutates between accesses and
could be immutable.
Ron
More information about the Python-3000
mailing list