esoteric question about dict keys

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Aug 26 05:05:14 CEST 2004


> In article <mailman.2023.1092997148.5135.python-list at python.org>,
> Alexis Roda <alexis.roda at urv.es> wrote:
> 
>> If I write my own dictionary-like
>> object, on wich the mutability of the keys is not a technical issue, is
>> considered blasphemous the use of dicts as keys?

No, not at all. If the algorithm you use for looking
up your mapping doesn't have any problem with mutability,
then using a dict (or indeed any comparable object)
as a key is fine.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list