

def append(self, event_key, propagate):
    target = event_key.dispatch_target
    assert isinstance(target, type), 'Class-level Event targets must be classes.'
    stack = [target]
    while stack:
        cls = stack.pop(0)
        stack.extend(cls.__subclasses__())
        if ((cls is not target) and (cls not in self._clslevel)):
            self.update_subclass(cls)
        else:
            if (cls not in self._clslevel):
                self._clslevel[stack] = collections.deque()
            self._clslevel[cls].append(event_key._listen_fn)
    registry._stored_in_collection(event_key, self)

dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/event/attr.py _ClsLevelDispatch.append/VarMisuse@110/144 `cls`->`stack`