Raymond Hettinger <raymond.hettinger at gmail.com> added the comment: Instead of a O(n) simulation, an O(1) equivalent should be used. ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue37439> _______________________________________