From 25506d497ceb31f83545c40b708c221f52608823 Mon Sep 17 00:00:00 2001 From: rowan Date: Mon, 6 Oct 2025 05:28:21 -0400 Subject: [PATCH] remove test code --- src/puppygirl/__init__.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/puppygirl/__init__.py b/src/puppygirl/__init__.py index 0198dd9..04475f6 100644 --- a/src/puppygirl/__init__.py +++ b/src/puppygirl/__init__.py @@ -14,11 +14,6 @@ class Clonable[T = Self](Protocol): def clone(self) -> T: return copy(self) -def to_element(value: ElementLike) -> "Element": - if isinstance(value, Element): - return value - return Element(value) - # tag names PgSlotName = "puppygirl-slot" TemplateName = "template" @@ -42,6 +37,11 @@ class Element(Clonable): self.value = value + def from_element_like(value: ElementLike) -> Self: + if isinstance(value, Element): + return value + return Element(value) + def clone(self) -> Self: return Element(copy(self.value)) @@ -195,7 +195,3 @@ class Puppygirl: tag.replace_with(new_tag) return tree - -pg = Puppygirl([PuppygirlSlot]) -tree = pg.fetch("mdn.html") -print(tree.prettify())