Skip to content

Commit 9e14226

Browse files
committed
chore: add some type ignores where mypy can't infer the generic, not the
most elegant
1 parent 6d821a4 commit 9e14226

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fasthx/htmy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ def _make_render_context(self, request: Request, route_params: dict[str, Any]) -
263263
return result
264264

265265

266-
def _default_component_selector(route_result: Any) -> Any:
266+
def _default_component_selector(route_result: Any) -> h.Component:
267267
"""
268268
Default component selector that returns the route result as is.
269269
270270
It is assumed (and not validated) that the route result is a `htmy.Component` when
271271
this component selector is used. Otherwise rendering will fail.
272272
"""
273-
return route_result
273+
return route_result # type: ignore[no-any-return]

tests/test_htmy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ def header_with_no_default() -> User:
7777
return billy
7878

7979
@app.get("/hx-no-selector", response_model=None)
80-
@htmy.hx() # HelloWorld is a component, render it as is.
80+
@htmy.hx() # type: ignore[arg-type] # HelloWorld is a component, render it as is.
8181
def hx_no_selector() -> HelloWorld:
8282
return HelloWorld()
8383

8484
@app.get("/page-no-selector", response_model=None)
85-
@htmy.page() # HelloWorld is a component, render it as is.
85+
@htmy.page() # type: ignore[arg-type] # HelloWorld is a component, render it as is.
8686
def page_no_selector() -> HelloWorld:
8787
return HelloWorld()
8888

0 commit comments

Comments
 (0)