¡@

Home 

python Programming Glossary: orderedset

Does Python have an ordered set?

http://stackoverflow.com/questions/1653970/does-python-have-an-ordered-set

set except that initialisation should be done with a list. OrderedSet 1 2 3 This is a MutableSet so the signature for .union doesn't.. can easily be added @staticmethod def union sets union OrderedSet union.union sets return union def union self sets for set in..

Indexable weak ordered set in Python

http://stackoverflow.com/questions/7828444/indexable-weak-ordered-set-in-python

nose.tools import import blist import weakref class WeakOrderedSet blist.weaksortedset A blist.weaksortedset whose key is the.. value self.value value x Dummy i for i in range 10 w WeakOrderedSet reversed x del w 2 8 assert_equals 9 8 1 0 i.value for i in.. and the MutableSet ABC make it easy to write an OrderedSet. Likewise you can reuse the existing weakref.WeakSet and replace..

Python OrderedSet with .index() method

http://stackoverflow.com/questions/7998692/python-orderedset-with-index-method

OrderedSet with .index method Does anyone know about a fast OrderedSet.. with .index method Does anyone know about a fast OrderedSet implementation for python that remembers insertion order has.. it in a subclass. Here is a basic implementation for the OrderedSet you linked in a comment class IndexOrderedSet OrderedSet def..