Skip to content

Commit 2cf0a30

Browse files
committed
Add xml.Node.__str__() alias for .encode()
1 parent b19a3fe commit 2cf0a30

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

base/src/xml.act

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ n.text and c.tail for all children of n.
2323
def encode(self) -> str:
2424
NotImplemented
2525

26+
def __str__(self):
27+
return self.encode()
28+
2629
def __repr__(self):
2730
# Building the arguments to xml.Node() and skip arguments where the
2831
# current value equals the default. We do this with appending to a

0 commit comments

Comments
 (0)