

def for_modify(self, obj):
    'Return an event collection which can be modified.\n\n        For _EmptyListener at the instance level of\n        a dispatcher, this generates a new\n        _ListenerCollection, applies it to the instance,\n        and returns it.\n\n        '
    result = _ListenerCollection(self.parent, obj._instance_cls)
    if (getattr(obj, self.name) is self):
        setattr(obj, self.name, result)
    else:
        assert isinstance(getattr(obj, self.name), _JoinedListener)
    return result

dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/event/attr.py _EmptyListener.for_modify/original