Skip to content

Commit 492721e

Browse files
committed
Dict -> Mapping
1 parent 6dcb22d commit 492721e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/src/features/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Convert any Django view into a IDOM component by usng this decorator. Compatible
3535

3636
| Type | Description |
3737
| --- | --- |
38-
| `Callable[[HttpRequest | None, Sequence | None, Dict | None], Component]` | A function that takes a `request=...`, `args=...`, and `kwargs=...` and returns an IDOM component. |
38+
| `Callable[[HttpRequest | None, Sequence | None, Mapping | None], Component]` | A function that takes a `request=...`, `args=...`, and `kwargs=...` and returns an IDOM component. |
3939

4040
??? warning "Existing limitations"
4141

src/django_idom/components.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import json
44
import os
55
from inspect import iscoroutinefunction
6-
from typing import Any, Callable, Dict, Sequence
6+
from typing import Any, Callable, Mapping, Sequence
77

88
from channels.db import database_sync_to_async
99
from django.contrib.staticfiles.finders import find
@@ -26,7 +26,7 @@ def _view_to_component(
2626
strict_parsing: bool,
2727
request: HttpRequest | None,
2828
args: Sequence | None,
29-
kwargs: Dict | None,
29+
kwargs: Mapping | None,
3030
):
3131
converted_view, set_converted_view = hooks.use_state(None)
3232
args = args or ()
@@ -110,7 +110,7 @@ def view_to_component(
110110
compatibility: bool = False,
111111
transforms: Sequence[Callable[[VdomDict], Any]] = (),
112112
strict_parsing: bool = True,
113-
) -> Callable[[HttpRequest | None, Sequence | None, Dict | None], Component]:
113+
) -> Callable[[HttpRequest | None, Sequence | None, Mapping | None], Component]:
114114
"""Converts a Django view to an IDOM component.
115115
116116
Keyword Args:
@@ -135,7 +135,7 @@ def decorator(view: Callable | View):
135135
def wrapper(
136136
request: HttpRequest | None = None,
137137
args: Sequence | None = None,
138-
kwargs: Dict | None = None,
138+
kwargs: Mapping | None = None,
139139
):
140140
return _view_to_component(
141141
view=view,

0 commit comments

Comments
 (0)