Project

General

Profile

« Previous | Next » 

Revision 6224

dicts.py: join(): Added support for unhashable types, which are passed through. This adds support for SQL literal values which are dicts (hstores).

View differences:

dicts.py
89 89
    '''
90 90
    new_dict = {}
91 91
    for out, in_ in dict0.iteritems():
92
        new_dict[out] = dict1.get(in_, in_) # use in_ if no match found
92
        try: out_value = dict1.get(in_, in_) # use in_ if no match found
93
        except TypeError: out_value = in_ # unhashable type
94
        new_dict[out] = out_value
93 95
    return new_dict

Also available in: Unified diff