nineml.utility.safe_dictionary_merge

nineml.utility.safe_dictionary_merge(dictionaries)[source]

Safely merge multiple dictionaries into one

Merges an iterable of dictionaries into a new single dictionary, checking that there are no key collisions

>>> safe_dictionary_merge( [ {1:'One',2:'Two'},{3:'Three'} ] ) 
{1: 'One', 2: 'Two', 3: 'Three'} 
>>> safe_dictionary_merge( [ {1:'One',2:'Two'},{3:'Three',1:'One'} ] ) 
NineMLRuntimeError: Key Collision while merging dictionarys