Hide keyboard shortcuts

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 

4 

5R = TypeVar("R") 

6S = TypeVar("S") 

7 

8logger = logging.getLogger(__name__) 

9 

10 

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