python Programming Glossary: frozenset
Python simulate keydown http://stackoverflow.com/questions/11906925/python-simulate-keydown import string UPPER frozenset '~ @# ^ _ QWERTYUIOP ASDFGHJKL ZXCVBNM ' LOWER frozenset `1234567890.. frozenset '~ @# ^ _ QWERTYUIOP ASDFGHJKL ZXCVBNM ' LOWER frozenset `1234567890 qwertyuiop asdfghjkl 'zxcvbnm . ORDER string.ascii_letters..
Fastest way to convert a dict's keys & values from `unicode` to `str`? http://stackoverflow.com/questions/1254454/fastest-way-to-convert-a-dicts-keys-values-from-unicode-to-str share improve this question DATA u'spam' u'eggs' u'foo' frozenset u'Gah ' u'bar' u'baz' 97 u'list' u'list' True u'Maybe' set u'and'.. u'list' True u'Maybe' set u'and' u'a' u'set' 1 u'foo' frozenset u'Gah ' u'bar' u'baz' 97 u'spam' u'eggs' # 'bar' 'baz' 97 'foo'.. ' u'bar' u'baz' 97 u'spam' u'eggs' # 'bar' 'baz' 97 'foo' frozenset 'Gah ' 'list' 'list' True 'Maybe' set 'and' 'a' 'set' 1 'spam'..
Using a Python Dictionary as a Key (Non-nested) http://stackoverflow.com/questions/1600591/using-a-python-dictionary-as-a-key-non-nested
Using non-hashable Python objects as keys in dictionaries http://stackoverflow.com/questions/1611797/using-non-hashable-python-objects-as-keys-in-dictionaries the special case of using non nested dictionaries as keys frozenset a.items #Can be put in the dictionary instead Is there a method..
efficiently knowing if intersection of two list is empty or not, in python http://stackoverflow.com/questions/2197482/efficiently-knowing-if-intersection-of-two-list-is-empty-or-not-in-python x in L 1000 loops best of 3 374 µs per loop timeit m_set frozenset M any x in m_set for x in L 10000 loops best of 3 31 µs per.. in L 100000 loops best of 3 4.88 µs per loop timeit m_set frozenset M any x in m_set for x in L 100000 loops best of 3 9.39 µs per.. x in L 1000 loops best of 3 168 µs per loop timeit m_set frozenset M any x in m_set for x in L 1000 loops best of 3 371 µs per..
Are Python built-in containers thread-safe? http://stackoverflow.com/questions/2227169/are-python-built-in-containers-thread-safe be modified ie concurrent reads are ok so immutable types frozenset tuple str are probably safe but it wouldn't hurt. For things..
what would be a frozen dict? http://stackoverflow.com/questions/2703599/what-would-be-a-frozen-dict would be a frozen dict A frozen set is a frozenset. A frozen list could be a tuple. What would be a frozen dict.. though it would still probably be useful more often than frozenset is . The most common reason to want such a type is when memoizing..
list of all paths from source to sink in directed acyclic graph [duplicate] http://stackoverflow.com/questions/3278481/list-of-all-paths-from-source-to-sink-in-directed-acyclic-graph if source_node sink_node # Handle trivial case return frozenset source_node else result set for new_source in source_node.children.. in paths path source_node path result.add path result frozenset result return result My main concern is that this does a depth.. source_node sink_node # Don't memoize trivial case return frozenset source_node else pair source_node sink_node if pair in memo_dict..
Hashing a python dictionary http://stackoverflow.com/questions/5884066/hashing-a-python-dictionary share improve this question You could make a frozenset with the dict's items and use hash hash frozenset my_dict.items..
What is the most efficient way in Python to convert a string to all lowercase stripping out all non-ascii alpha characters? http://stackoverflow.com/questions/638893/what-is-the-most-efficient-way-in-python-to-convert-a-string-to-all-lowercase-st values for str_join_set and translate letter_set frozenset string.ascii_lowercase string.ascii_uppercase tab string.maketrans..
|