Coverage for jutil/dict.py : 0%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import logging
2from collections import OrderedDict
3from typing import Dict, TypeVar
5R = TypeVar('R')
6S = TypeVar('S')
8logger = logging.getLogger(__name__)
11def sorted_dict(d: Dict[S, R]) -> Dict[S, R]:
12 """
13 Returns dict sorted by ascending key
14 :param d: dict
15 :return: OrderedDict
16 """
17 return OrderedDict(sorted(d.items()))