[yunqa.de] Delphi structure ?

  • From: Luc <lucdesa@xxxxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Wed, 13 Apr 2011 17:39:15 +0200

Hello,
For a new project i need to implement a special structure In Delphi which exists in Python.

Is there an equivalent structure in DIContainers for the python Dict(set) implementation. This is a structure which hashes to a uniqe key but the value consists of multiple sets.

example in python:

db=defaultdict(set)
db[1,2].add('test1')
db[1,2].add('test 2')
db[1,2].add('test 3')
print db

gives as result:

defaultdict(<type 'set'>, {(1, 2): set(['test1', 'test 2', 'test 3'])})

hask key (1,2) has multiple results as a set (test1,test2,test3)

Many thx

Luc



_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: