python Programming Glossary: self.insertion_order
Indexable weak ordered set in Python http://stackoverflow.com/questions/7828444/indexable-weak-ordered-set-in-python key is the insertion order. def __init__ self iterable self.insertion_order weakref.WeakKeyDictionary # value_type to int self.last_key.. # value_type to int self.last_key 0 super .__init__ key self.insertion_order.__getitem__ for item in iterable self.add item def __delitem__.. values for value in values if value not in self del self.insertion_order value def add self value # Choose a key so that value is on..
|