def cdd(d, k):
    """ Conditionally delete key (or list of keys) 'k' from dict 'd' """
    if not isinstance(k, list):
        k = [k]
    for i in k:
        if i in d:
            d.pop(i)
def cdd(d, k):
    """ Conditionally delete key (or list of keys) 'k' from dict 'd' """
    if not isinstance(k, list):
        k = [k]
    for i in k:
        if i in d:
            d.pop(i)
def cdd ( d , k ) : if not isinstance ( k , list ) : k = [ k ] for i in k : if i in d : d . pop ( i )
Conditionally delete key (or list of keys) 'k' from dict 'd'
Conditionally delete key ( or list of keys ) k from dict d