(o)
return o
Freezes any mutable object including dictionaries and lists for hashing.
    Accepts nested dictionaries.
Freezes any mutable object including dictionaries and lists for hashing.
    Accepts nested dictionaries.
Freezes any mutable object including dictionaries and lists for hashing . Accepts nested dictionaries .
def freeze(o):
    """
    Freezes any mutable object including dictionaries and lists for hashing.
    Accepts nested dictionaries.
    """
    if isinstance(o, (tuple, list)):
        return tuple(sorted((freeze(e) for e in o), key=_FreezeKey))

    if isinstance(o, dict):
        return tuple(sorted(((k, freeze(v)) for k, v in iteritems(o)), key=_item_freeze_key))

    if isinstance(o, (set, frozenset)):
        return tuple(sorted((freeze(e) for e in o), key=_FreezeKey))

    return o
def freeze ( o ) : if isinstance ( o , ( tuple , list ) ) : return tuple ( sorted ( ( freeze ( e ) for e in o ) , key = _FreezeKey ) ) if isinstance ( o , dict ) : return tuple ( sorted ( ( ( k , freeze ( v ) ) for k , v in iteritems ( o ) ) , key = _item_freeze_key ) ) if isinstance ( o , ( set , frozenset ) ) : return tuple ( sorted ( ( freeze ( e ) for e in o ) , key = _FreezeKey ) ) return o