I changed bsddb so that it consistently produces and consumes bytes only, and added convenience wrappers StringKeys and StringValues for people whose database are known to store only strings as either keys or values; those get UTF-8 encoded.
While I could fix test_bsddb with these changes, anydbm and whichdb broke, as they expect to use string keys. Changing them to use bytes keys then broke dumbdbm, which uses a dictionary internally for the index. This brings me to join others in the desire for immutable bytes objects: I think such a type is needed, and it should probably use the same hash algorithm as str8. 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. If that is not acceptable, please tell me how else to fix the dbm modules. Regards, Martin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com