This commit is contained in:
John Lancaster
2026-02-20 23:49:13 -06:00
parent b01b67cc36
commit 4ba1833811
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ class DAG(Generic[T], MutableMapping[T, MutableSet[T]]):
return iter(self._succ)
def __len__(self) -> int:
return len(self._succ)
return sum(map(len, self._succ.values()))
def __repr__(self) -> str:
return f"{self.__class__.__name__}{dict(self._succ)!r}"

View File

@@ -52,7 +52,7 @@ class DAGSet(MutableSet[T]):
def discard(self, v: T) -> None:
self._data.discard(v)
if self.on_remove:
self.on_remove()
self.on_remove(v)
# --- in-place operator support ---