def dict_no_dupl(it):
    d = {}
for k, v in it:
    if k in d:
        raise DuplicateKeyError(k)
d[k] = v
return d
dict_no_dupl((k, v) for k, v in ('a1', 'a2', 'b3'))
Raise error if a Python dict comprehension overwrites a key