Skip to content

Commit 3b4a55e

Browse files
committed
Remove prefix on non-public attribute helpers
These are still private as they are defined and exclusively used in private modules.
1 parent 1a7a92c commit 3b4a55e

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

htpy/_attributes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def _class_names_for_items(items: t.Any) -> t.Any:
4343
yield item
4444

4545

46-
def _id_class_names_from_css_str(x: t.Any) -> Mapping[str, Attribute]: # pyright: ignore[reportUnusedFunction]
46+
def id_class_names_from_css_str(x: t.Any) -> Mapping[str, Attribute]:
4747
if not isinstance(x, str):
4848
raise TypeError(f"id/class strings must be str. got {x}")
4949

@@ -91,7 +91,7 @@ def _generate_attrs(raw_attrs: Mapping[str, Attribute]) -> Iterable[tuple[str, A
9191
yield _force_escape(key), _force_escape(value)
9292

9393

94-
def _attrs_string(attrs: Mapping[str, Attribute]) -> str: # pyright: ignore[reportUnusedFunction]
94+
def attrs_string(attrs: Mapping[str, Attribute]) -> str:
9595
result = " ".join(k if v is True else f'{k}="{v}"' for k, v in _generate_attrs(attrs))
9696

9797
if not result:

htpy/_elements.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
import typing as t
66
from collections.abc import Callable, Iterable
77

8-
from htpy._attributes import (
9-
_attrs_string, # pyright: ignore[reportPrivateUsage]
10-
_id_class_names_from_css_str, # pyright: ignore[reportPrivateUsage]
11-
)
8+
from htpy._attributes import attrs_string, id_class_names_from_css_str
129
from htpy._contexts import ContextConsumer, ContextProvider
1310
from htpy._fragments import Fragment
1411
from htpy._rendering import chunks_as_markup, iter_chunks_node
@@ -79,9 +76,9 @@ def __call__(self: BaseElementSelf, *args: t.Any, **kwargs: t.Any) -> BaseElemen
7976

8077
return self.__class__(
8178
self._name,
82-
_attrs_string(
79+
attrs_string(
8380
{
84-
**(_id_class_names_from_css_str(id_class) if id_class else {}),
81+
**(id_class_names_from_css_str(id_class) if id_class else {}),
8582
**attrs,
8683
**{_python_to_html_name(k): v for k, v in kwargs.items()},
8784
}

0 commit comments

Comments
 (0)