Eric Snow <ericsnowcurren...@gmail.com> added the comment:

Please don't miss the fact that the main reason for mirroring the dict table is 
to get O(1) node lookup (in the linked list).  Otherwise most lookup-dependent 
operations, like __delitem__(), would become O(n); whereas in the pure-Python 
implementation they are O(1).  This is all explained in the notes at the top of 
Objects/odictobject.c.

Also, I didn't change anything in the dict implementation to rely on the 
OrderedDict implementation.  So while I would say OrderedDict is coupled to 
dict, I wouldn't say the reverse, that dict is coupled to OrderedDict.  If dict 
changes then OrderedDict must be updated apporpropriately, but not vice-versa.  
That should still hold.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31954>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to