def map_items(func, v):
    'A helper to apply `func` to all elements (keys and values) within dict\n\n    No type checking of values passed to func is done, so `func`\n    should be resilient to values which it should not handle\n\n    Initial usecase - apply_recursive(url_fragment, ensure_unicode)\n    '
    return v.__class__((item.__class__(map(func, item)) for item in v.items()))
A helper to apply `func` to all elements (keys and values) within dict

No type checking of values passed to func is done, so `func`
should be resilient to values which it should not handle

Initial usecase - apply_recursive(url_fragment, ensure_unicode)
def map_items(func, v):
    'A helper to apply `func` to all elements (keys and values) within dict\n\n    No type checking of values passed to func is done, so `func`\n    should be resilient to values which it should not handle\n\n    Initial usecase - apply_recursive(url_fragment, ensure_unicode)\n    '
    return v.__class__((item.__class__(map(func, item)) for item in v.items()))