Coverage for jutil/dict.py: 0%

# Coverage for jutil/dict.py : 0%

## 8 statements

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

1 import logging

2 from collections import OrderedDict

3 from typing import Dict, TypeVar

4

5 R = TypeVar("R")

6 S = TypeVar("S")

7

8 logger = logging.getLogger(__name__)

9

10

11 def 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()))