I would like to use a dictionary that only allows a single write of any specific key.
Is there a (fool-proof) python subclass for a dictionary that will raise an exception when trying to overwrite a key?
EDIT: Alternatively, is there a simple way to throw an exception that is fool-proof for any type of dictionary update?