':type attribute: str
:type ui: UIElement
:type property: str, None'

def __init__(self, obj, attribute, ui, property=None):

    Binding.__init__(self, obj, attribute, ui)
    if (property is None):
        v = self.__get_transformed()
        for prop in ui.property_definitions.values():
            if prop.bindtypes:
                if ((type(v) in prop.bindtypes) or (v is None) or (object in prop.bindtypes)):
                    self.property = prop.name
                    break
        else:
            raise Exception(('Cannot    bind    %s.%s    (%s,    =    %s)    to    %s' % (repr(obj), attribute, repr(type(v)), repr(v), ui)))
    else:
        self.property = property
    self.oneway = (ui.bindtransform is not None)
