From c75e6f4040680c6ef982ec7ef923181810ceba1f Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 27 Sep 2024 15:34:23 -0400 Subject: [PATCH] Update _core.py --- htmltools/_core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htmltools/_core.py b/htmltools/_core.py index 8226024..f645633 100644 --- a/htmltools/_core.py +++ b/htmltools/_core.py @@ -254,7 +254,10 @@ def _repr_html_(self) -> str: ... # ============================================================================= # TagList class # ============================================================================= -class TagList(UserList[TagNode]): +_TagListParentClass = UserList if sys.version_info <= (3, 8) else UserList[TagNode] + + +class TagList(_TagListParentClass): """ Create an HTML tag list (i.e., a fragment of HTML)