Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 1d1ca0b

Browse files
committed
Add a TODO related to typing of component attributes.
1 parent e7b1af5 commit 1d1ca0b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

html_tstring/processor.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def _instrument(
7777
"""
7878
count = len(strings)
7979

80-
print("Instrumenting:", strings, callable_ids) # DEBUG
81-
8280
callable_placeholders: dict[int, str] = {}
8381

8482
for i, s in enumerate(strings):
@@ -107,9 +105,7 @@ def _instrument_and_parse_internal(
107105
The result is cached to avoid re-parsing the same template multiple times.
108106
"""
109107
instrumented = _instrument(strings, callable_ids)
110-
i_list = list(instrumented)
111-
print("Instrumented:", "".join(i_list)) # DEBUG
112-
return parse_html(i_list)
108+
return parse_html(instrumented)
113109

114110

115111
def _callable_id(value: object) -> int | None:
@@ -333,7 +329,6 @@ def _invoke_component(
333329
)
334330
# Call the component and return the resulting node
335331
result = value(*new_children, **new_attrs)
336-
print("RESULTIS:", result) # DEBUG
337332
match result:
338333
case Node():
339334
return result

html_tstring/processor_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ def test_interpolated_style_attribute():
475475
# --------------------------------------------------------------------------
476476

477477

478+
# TODO: I need to get precise about the typing story here. *IS* `second`
479+
# really an `int`? After all, the processor has already substituted the
480+
# attributes, so it may be a `str` at this point.
478481
def TemplateComponent(
479482
*children: Node, first: str, second: int, third: str, **attrs: t.Any
480483
) -> Template:
@@ -538,7 +541,6 @@ def test_component_passed_as_attr_value():
538541
def WrapperComponent(
539542
*children: Node, another: ComponentCallable, **attrs: t.Any
540543
) -> Template:
541-
print("WrapperComponent called with:", type(another), another)
542544
return t"<{another} {attrs}>{children}</{another}>"
543545

544546
node = html(

0 commit comments

Comments
 (0)