Skip to content

Commit b33cf45

Browse files
authored
Replace pipe annotations (#9)
1 parent fecd467 commit b33cf45

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

hyperscript/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from __future__ import annotations
22

3-
from typing import Any
3+
from typing import Any, Optional
44

55
from hyperscript.element import Element, SafeStr
66

77
AUTOESCAPE = True
88

99

1010
def h(
11-
tag: str, *args: Any, autoescape: bool | None = None, remove_empty: bool = False
11+
tag: str, *args: Any, autoescape: Optional[bool] = None, remove_empty: bool = False
1212
) -> Element:
1313
if autoescape is None:
1414
autoescape = AUTOESCAPE

hyperscript/element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import re
44
from html import escape
5-
from typing import Any, Mapping
5+
from typing import Any, Mapping, Union
66

77
TAG_PATTERN = re.compile(r"([.#]?[^\s#.]+)")
88
VOID_ELEMENTS = {
@@ -77,7 +77,7 @@ def parse_args(self, args: tuple[Any]) -> tuple[dict[str, Any], list[Any]]:
7777
children.append(arg)
7878
return attrs, children
7979

80-
def parse_style(self, style: str | dict[str, str]) -> str:
80+
def parse_style(self, style: Union[str, dict[str, str]]) -> str:
8181
if isinstance(style, str):
8282
return style
8383
return "; ".join(f"{k}: {v}" for k, v in style.items())

0 commit comments

Comments
 (0)