properly modifies a dict or class attribute

def modify_member(row, key, value):
    ''' properly modifies a dict or class attribute '''
    (target, tkey, tvalue) = dict_crawl(row, key)
    if target:
        target[tkey] = value
    return row