Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def_dict = defaultdict(lambda: {"value": "", "isIncreased": False, "isDecreased": False})
- my_dict = defaultdict(lambda: def_dict)
- # PyCharm raises warning for two lines below, but it works
- my_dict['current_half_over_under'] = defaultdict(lambda: def_dict)
- my_dict['full_time_over_under'] = defaultdict(lambda: def_dict)
- # And to set "handicap" keys in "full_time_over_under" and "current_half_over_under" dictionaries we should access it via
- # my_dict.setdefault('handicap', some_value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement