How to create an array which can be used also as a dictionary

Terry Reedy tjreedy at udel.edu
Thu Sep 10 18:26:47 EDT 2009


Hans Müller wrote:
> Hello,
> 
> I have a lot of items having a name and a given sequence.
> 
> To access these items fast in a sequence order they should be used as a 
> list, but to be fetched fast by name they also should be in a dictionary.

Have you looked at namedtuple or OrderedDict in collections module?




More information about the Python-list mailing list