3 ms·
`method2` looks buggy. On the question "who whould want to use", here's an example: OrderedSet could be implemented using double-linked list http://code.acti
by d0mine 17y ago
`method2` looks buggy.
On the question "who whould want to use", here's an example:
OrderedSet could be implemented using double-linked list http://code.activestate.com/recipes/576696-orderedset-with-weakrefs/ http://code.activestate.com/recipes/576696-orderedset-with-w...
Here's "real code" from stdlib (OrderedDict implementation) http://svn.python.org/view/python/trunk/Lib/collections.py?view=markup http://svn.python.org/view/python/trunk/Lib/collections.py?v...
- viraptor 17y ago> `method2` looks buggy. Claim looks unfounded. (unless you can tell what looks buggy) I'm not sure why they used a D-L list, but thanks for the link - I'll try to reimplement it with standard lists in a bit and run some bigger benchmark on it. Maybe collections need some tweaking? (I'm not saying list is always faster, only that it is for this specific example)