From 9cf644aef5f301726028a9facc1110800819f557 Mon Sep 17 00:00:00 2001 From: rmorshea Date: Thu, 2 Feb 2023 18:25:54 -0800 Subject: [PATCH 1/2] fix type hint annoyance --- pyproject.toml | 1 + src/idom/core/types.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 633c3156a..bedddad4d 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, From 63317612a0affe14b7f5d3efa2f4bbc5afb515bd Mon Sep 17 00:00:00 2001 From: rmorshea Date: Thu, 2 Feb 2023 18:29:45 -0800 Subject: [PATCH 2/2] add changelog --- docs/source/about/changelog.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst index f0ab83e15..bd2120be7 100644 --- a/docs/source/about/changelog.rst +++ b/docs/source/about/changelog.rst @@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide `. Unreleased ---------- -No changes. +**Fixed** + +- :pull:`908` - minor type hint issue with ``VdomDictConstructor`` v1.0.0-a2