Re: [Python-Dev] frozenset C API?

Sept. 4, 2007
8:19 p.m.
[Bill Janssen]
Dicts, sets and frozenset are implemented as hash tables, not as arrays, so the above suggestion doesn't make any sense to me. The location of the "next empty slot" depends on a the key associated with the value being added (btw, where is the "key" handled in your proposed API?). Consequently, the PyDict_New(int) step would have no way to know where to create the n empty slots (since their location is determined by the hash value of the keys). That is a reason that the tuple/list API differs from the set/frozenet/dict API. Raymond
6404
Age (days ago)
6404
Last active (days ago)
1 comments
2 participants
participants (2)
-
Bill Janssen
-
Raymond Hettinger