Stephen Hansen schrieb: > Now, I believe Python sets *are* for all intents and purposes > dictionaries, but I think that's just because its the easiest and most > efficient way to implement their uniqueness properties; they took the > very-well-tuned dictionary implementation and cut out the stuff not > needed by sets and did some tweaks here or there. I /believe/.
You are correct. The first set implementation in pure Python was using a dict as internal storage. The new set implementation is heavily based on the highly optimized dict code. Sets are basically dicts without values. from Objects/setobject.c set object implementation Written and maintained by Raymond D. Hettinger <pyt...@rcn.com> Derived from Lib/sets.py and Objects/dictobject.c. -- http://mail.python.org/mailman/listinfo/python-list