Closed timoniq closed 3 months ago
a node must allow adding multiple compose implementations
for different sets of child nodes. (this may have a lot of test cases to handle)
class Text(ScalarNode, str): @composer async def compose_message(cls, message: MessageNode) -> typing.Self: ... return cls(message.text.unwrap()) @composer async def compose_caption(cls, attachment: Attachment) -> typing.Self: # works with attachments with caption ... return cls(attachment.caption.unwrap())
a node must allow adding multiple compose implementations
for different sets of child nodes. (this may have a lot of test cases to handle)