On Sat, Aug 1, 2020 at 9:55 AM Marco Sulla <[email protected]> wrote: > > On Sat, 1 Aug 2020 at 02:30, Stestagg <[email protected]> wrote: >> >> The dict keys is compact only *until* you delete an item, at which point, a >> hole is left in the array > > No, the array of items has no hole. The hole is inserted in the hashtable.
Yes, the array of items has hole. Otherwise, `del d[k]` become `O(n)`, or `del d[k]` won't preserve insertion order. Please teach me if you know any algorithm which has no hole, O(1) deletion, preserving insertion order, and efficient and fast as array. -- Inada Naoki <[email protected]> _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/TH27RES3NQYIVZE7YD2QEQRAK7UCDVXL/ Code of Conduct: http://python.org/psf/codeofconduct/
