aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2024-03-03 17:47:27 +0100
committerNao Pross <np@0hm.ch>2024-03-03 17:47:27 +0100
commitd1a453803b419e59d2e9bcd60a1851f43f08aadd (patch)
treea4dd646a54740ecbd68bf53913bc6f406e47da62
parentFix typo in method name (diff)
downloadmdpoly-d1a453803b419e59d2e9bcd60a1851f43f08aadd.tar.gz
mdpoly-d1a453803b419e59d2e9bcd60a1851f43f08aadd.zip
Rename Repr.nodes() to Repr.children()
This is to avoid confusing code like node.nodes()
Diffstat (limited to '')
-rw-r--r--mdpoly/abc.py2
-rw-r--r--mdpoly/algebra.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/mdpoly/abc.py b/mdpoly/abc.py
index b127e8b..9977d65 100644
--- a/mdpoly/abc.py
+++ b/mdpoly/abc.py
@@ -26,7 +26,7 @@ class Expr(Protocol):
name = self.__class__.__qualname__
return f"{name}(left={self.left}, right={self.right})"
- def nodes(self) -> Sequence[Self]:
+ def children(self) -> Sequence[Self]:
""" Iterate over the two nodes """
return self.left, self.right
diff --git a/mdpoly/algebra.py b/mdpoly/algebra.py
index 5b3c597..6f046b7 100644
--- a/mdpoly/algebra.py
+++ b/mdpoly/algebra.py
@@ -183,7 +183,7 @@ class Add(Expr, HasRepr, PolyRingAlgebra):
entry = MatrixIndex.scalar
# Make representations for existing stuff
- for node in self.nodes():
+ for node in self.children():
nrepr, state = node.to_repr(repr_type, state)
# Process non-zero terms