Project

General

Profile

« Previous | Next » 

Revision 466

util.py: Added dict_subset()

View differences:

util.py
15 15
    except StopIteration: pass # nothing after the matching elements
16 16

  
17 17
def rename_key(dict_, orig, new): dict_[new] = dict_.pop(orig)
18

  
19
def dict_subset(dict_, keys): dict([(key, dict_[key]) for key in keys])

Also available in: Unified diff