On 2016-06-13 17:34, Ethan Furman wrote: > On 06/10/2016 02:13 PM, Franklin? Lee wrote: > >> P.S.: If anyone is missing the relevance, Raymond Hettinger's compact >> dicts are inherently ordered until a delitem happens.[1] That could be >> "good enough" for many purposes, including kwargs and class definition. > > It would be great for kwargs, but not for class definition: del's can > happen there, so we need PEP 520 with OrderedDict so the definition > order is not lost when an item is deleted during class creation. > The order can be lost when an item is deleted because it moves the last item into the 'hole' left by the deleted item. This could be avoided by expanding the items to include the index of the 'previous' and 'next' item, so that they could be handled like a doubly-linked list. The disadvantage would be that it would use more memory.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4