Popular recipes by Adam Olsen http://code.activestate.com/recipes/users/4053512/2009-04-08T19:22:13-07:00ActiveState Code RecipesOrdered Set (Python) 2009-04-08T19:22:13-07:00Adam Olsenhttp://code.activestate.com/recipes/users/4053512/http://code.activestate.com/recipes/528878-ordered-set/ <p style="color: grey"> Python recipe 528878 by <a href="/recipes/users/4053512/">Adam Olsen</a> . Revision 3. </p> <p>An ordered set using insertion order. It can also be seen as a linked-list with a uniqueness constraint and O(1) lookups.</p> Alternative to __del__ using weakrefs and metaclasses (Python) 2007-05-03T23:57:17-07:00Adam Olsenhttp://code.activestate.com/recipes/users/4053512/http://code.activestate.com/recipes/519610-alternative-to-__del__-using-weakrefs-and-metaclas/ <p style="color: grey"> Python recipe 519610 by <a href="/recipes/users/4053512/">Adam Olsen</a> . </p> <p>This is an ever-so-slightly over engineered solution to using weakrefs instead of __del__. It provides a "core" object for all the attributes your cleanup code needs, then allows your main object to continue as normal by using descriptors.</p>