diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index 092d13006..656bae4df 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -23,6 +23,10 @@ more info, see the :ref:`Contributor Guide `. Unreleased ---------- +**Fixed** + +- :pull:`908` - minor type hint issue with ``VdomDictConstructor`` + **Removed** - :pull:`907` - accidental import of idom.testing diff --git a/pyproject.toml b/pyproject.toml index 31f15cdbf..dd81399e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ line_length = 88 lines_after_imports = 2 [tool.mypy] +incremental = false ignore_missing_imports = true warn_unused_configs = true warn_redundant_casts = true diff --git a/src/idom/core/types.py b/src/idom/core/types.py index 38a17481a..cd266be95 100644 --- a/src/idom/core/types.py +++ b/src/idom/core/types.py @@ -15,6 +15,7 @@ Type, TypeVar, Union, + overload, ) from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, runtime_checkable @@ -199,6 +200,23 @@ class EventHandlerType(Protocol): class VdomDictConstructor(Protocol): """Standard function for constructing a :class:`VdomDict`""" + @overload + def __call__( + self, + *children: VdomChild | VdomChildren, + key: Key | None = None, + **attributes: Any, + ) -> VdomDict: + ... + + @overload + def __call__( + self, + *children: VdomChild | VdomChildren, + **attributes: Any, + ) -> VdomDict: + ... + def __call__( self, *children: VdomChild | VdomChildren,