Skip to content

Commit c8adf95

Browse files
authored
fix type hint annoyance (#908)
* fix type hint annoyance * add changelog
1 parent aa26caa commit c8adf95

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

docs/source/about/changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
2323
Unreleased
2424
----------
2525

26+
**Fixed**
27+
28+
- :pull:`908` - minor type hint issue with ``VdomDictConstructor``
29+
2630
**Removed**
2731

2832
- :pull:`907` - accidental import of idom.testing

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ line_length = 88
1212
lines_after_imports = 2
1313

1414
[tool.mypy]
15+
incremental = false
1516
ignore_missing_imports = true
1617
warn_unused_configs = true
1718
warn_redundant_casts = true

src/idom/core/types.py

+18
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
Type,
1616
TypeVar,
1717
Union,
18+
overload,
1819
)
1920

2021
from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, runtime_checkable
@@ -199,6 +200,23 @@ class EventHandlerType(Protocol):
199200
class VdomDictConstructor(Protocol):
200201
"""Standard function for constructing a :class:`VdomDict`"""
201202

203+
@overload
204+
def __call__(
205+
self,
206+
*children: VdomChild | VdomChildren,
207+
key: Key | None = None,
208+
**attributes: Any,
209+
) -> VdomDict:
210+
...
211+
212+
@overload
213+
def __call__(
214+
self,
215+
*children: VdomChild | VdomChildren,
216+
**attributes: Any,
217+
) -> VdomDict:
218+
...
219+
202220
def __call__(
203221
self,
204222
*children: VdomChild | VdomChildren,

0 commit comments

Comments
 (0)