(obj, keypath, value)
return setKey(cur, elements[-1], value)
Set the value at 'keypath'. The keypath is a string containing a
    path of keys, seperated by dots.
Set the value at 'keypath'. The keypath is a string containing a
    path of keys, seperated by dots.
Set the value at keypath . The keypath is a string containing a path of keys seperated by dots .
def setKeyPath(obj, keypath, value):
    """
    Set the value at 'keypath'. The keypath is a string containing a
    path of keys, seperated by dots.
    """
    if obj is None:
        return

    if isinstance(obj, (objc.objc_object, objc.objc_class)):
        return obj.setValue_forKeyPath_(value, keypath)

    elements = keypath.split('.')
    cur = obj
    for e in elements[:-1]:
        cur = getKey(cur, e)

    return setKey(cur, elements[-1], value)
def setKeyPath ( obj , keypath , value ) : if obj is None : return if isinstance ( obj , ( objc . objc_object , objc . objc_class ) ) : return obj . setValue_forKeyPath_ ( value , keypath ) elements = keypath . split ( '.' ) cur = obj for e in elements [ : - 1 ] : cur = getKey ( cur , e ) return setKey ( cur , elements [ - 1 ] , value )