Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-immutabledict for 
openSUSE:Factory checked in at 2026-03-11 20:53:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-immutabledict (Old)
 and      /work/SRC/openSUSE:Factory/.python-immutabledict.new.8177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-immutabledict"

Wed Mar 11 20:53:01 2026 rev:10 rq:1338100 version:4.3.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-immutabledict/python-immutabledict.changes    
    2025-11-17 12:20:43.579059726 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-immutabledict.new.8177/python-immutabledict.changes
      2026-03-11 20:53:53.646417847 +0100
@@ -1,0 +2,12 @@
+Tue Mar 10 21:45:58 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 4.3.1:
+  * Fix: fix typing issues with pytype/pyrefly
+- update to 4.3.0:
+  * Add typed `__new__` overloads for type-safe constructor
+    calls.
+  * Fix: correct ImmutableOrderedDict _dict_cls so that it works
+    correctly. It actually silently used plain `dict` due to the
+    issue
+
+-------------------------------------------------------------------

Old:
----
  immutabledict-4.2.2.tar.gz

New:
----
  immutabledict-4.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-immutabledict.spec ++++++
--- /var/tmp/diff_new_pack.97IcIr/_old  2026-03-11 20:53:54.134437792 +0100
+++ /var/tmp/diff_new_pack.97IcIr/_new  2026-03-11 20:53:54.134437792 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-immutabledict
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -27,7 +27,7 @@
 %define         short_name immutabledict
 %{?sle15_python_module_pythons}
 Name:           python-%{short_name}%{psuffix}
-Version:        4.2.2
+Version:        4.3.1
 Release:        0
 Summary:        Immutable wrapper around dictionaries (a fork of frozendict)
 License:        MIT

++++++ immutabledict-4.2.2.tar.gz -> immutabledict-4.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/immutabledict-4.2.2/PKG-INFO 
new/immutabledict-4.3.1/PKG-INFO
--- old/immutabledict-4.2.2/PKG-INFO    1970-01-01 01:00:00.000000000 +0100
+++ new/immutabledict-4.3.1/PKG-INFO    1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: immutabledict
-Version: 4.2.2
+Version: 4.3.1
 Summary: Immutable wrapper around dictionaries (a fork of frozendict)
 License-Expression: MIT
 License-File: LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/immutabledict-4.2.2/immutabledict/__init__.py 
new/immutabledict-4.3.1/immutabledict/__init__.py
--- old/immutabledict-4.2.2/immutabledict/__init__.py   1970-01-01 
01:00:00.000000000 +0100
+++ new/immutabledict-4.3.1/immutabledict/__init__.py   1970-01-01 
01:00:00.000000000 +0100
@@ -16,9 +16,10 @@
     Type,
     TypeVar,
     ValuesView,
+    overload,
 )
 
-__version__ = "4.2.2"
+__version__ = "4.3.1"
 
 _K = TypeVar("_K")
 _V = TypeVar("_V", covariant=True)
@@ -39,9 +40,33 @@
     def fromkeys(  # noqa: D102
         cls, seq: Iterable[_K], value: Optional[_V] = None
     ) -> immutabledict[_K, _V]:
-        return cls(cls._dict_cls.fromkeys(seq, value))
+        return cls(cls._dict_cls.fromkeys(seq, value))  # type: 
ignore[call-overload, arg-type]
 
-    def __new__(cls, *args: Any, **kwargs: Any) -> immutabledict[_K, _V]:  # 
noqa: D102
+    @overload
+    def __new__(cls) -> immutabledict[_K, _V]: ...  # type: 
ignore[overload-overlap]
+
+    @overload
+    # Using Any for **kwargs because pytype and pyrefly don't infer
+    # a union TypeVar from heterogeneous kwargs values.
+    def __new__(cls, **kwargs: Any) -> immutabledict[str, Any]: ...
+
+    @overload
+    def __new__(cls, map: Mapping[_K, _V], /) -> immutabledict[_K, _V]: ...  # 
type: ignore[overload-overlap]
+
+    @overload
+    def __new__(
+        cls, map: Mapping[str, _V], /, **kwargs: Any
+    ) -> immutabledict[str, _V]: ...
+
+    @overload
+    def __new__(cls, iterable: Iterable[Tuple[_K, _V]], /) -> 
immutabledict[_K, _V]: ...
+
+    @overload
+    def __new__(
+        cls, iterable: Iterable[Tuple[str, _V]], /, **kwargs: Any
+    ) -> immutabledict[str, _V]: ...
+
+    def __new__(cls, *args: Any, **kwargs: Any) -> immutabledict[_K, _V]:  # 
type: ignore[misc]  # noqa: D102
         inst = super().__new__(cls)
         setattr(inst, "_dict", cls._dict_cls(*args, **kwargs))
         setattr(inst, "_hash", None)
@@ -165,4 +190,33 @@
     Same as :class:`immutabledict` but based on 
:class:`collections.OrderedDict`.
     """
 
-    dict_cls = OrderedDict
+    _dict_cls = OrderedDict
+
+    @overload
+    def __new__(cls) -> ImmutableOrderedDict[_K, _V]: ...  # type: 
ignore[overload-overlap]
+
+    @overload
+    # Using Any for **kwargs because pytype and pyrefly don't infer
+    # a union TypeVar from heterogeneous kwargs values.
+    def __new__(cls, **kwargs: Any) -> ImmutableOrderedDict[str, Any]: ...
+
+    @overload
+    def __new__(cls, map: Mapping[_K, _V], /) -> ImmutableOrderedDict[_K, _V]: 
...  # type: ignore[overload-overlap]
+
+    @overload
+    def __new__(
+        cls, map: Mapping[str, _V], /, **kwargs: Any
+    ) -> ImmutableOrderedDict[str, _V]: ...
+
+    @overload
+    def __new__(
+        cls, iterable: Iterable[Tuple[_K, _V]], /
+    ) -> ImmutableOrderedDict[_K, _V]: ...
+
+    @overload
+    def __new__(
+        cls, iterable: Iterable[Tuple[str, _V]], /, **kwargs: Any
+    ) -> ImmutableOrderedDict[str, _V]: ...
+
+    def __new__(cls, *args: Any, **kwargs: Any) -> ImmutableOrderedDict[_K, 
_V]:  # type: ignore[misc]  # noqa: D102
+        return super().__new__(cls, *args, **kwargs)  # type: 
ignore[return-value]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/immutabledict-4.2.2/pyproject.toml 
new/immutabledict-4.3.1/pyproject.toml
--- old/immutabledict-4.2.2/pyproject.toml      1970-01-01 01:00:00.000000000 
+0100
+++ new/immutabledict-4.3.1/pyproject.toml      1970-01-01 01:00:00.000000000 
+0100
@@ -1,6 +1,6 @@
 [project]
 name = "immutabledict"
-version = "4.2.2"
+version = "4.3.1"
 description = "Immutable wrapper around dictionaries (a fork of frozendict)"
 license = "MIT"
 authors = [
@@ -40,12 +40,13 @@
 
 [tool.poetry.group.dev.dependencies]
 coverage = "*"
-myst-parser = { version = ">=3.0.1,<4", python = ">=3.9" }
+mypy = "*"
+pyrefly = "*"
 pyright = "*"
 pytest = "*"
 pytest-cov = "*"
 ruff = "*"
-sphinx = { version = "^7.4", python = ">=3.9" }
+sphinx = { version = "^7.4", python = ">=3.12" }
 tox = "*"
 
 [tool.ruff]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/immutabledict-4.2.2/tests/test_immutabledict.py 
new/immutabledict-4.3.1/tests/test_immutabledict.py
--- old/immutabledict-4.2.2/tests/test_immutabledict.py 1970-01-01 
01:00:00.000000000 +0100
+++ new/immutabledict-4.3.1/tests/test_immutabledict.py 1970-01-01 
01:00:00.000000000 +0100
@@ -282,7 +282,7 @@
                 "b": "2",
                 "c": "3",
             }
-        )  # type: ignore
+        )
         itered_keys = list(ordered)
         assert itered_keys[0] == "a"
         assert itered_keys[1] == "b"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/immutabledict-4.2.2/tests/test_typing.py 
new/immutabledict-4.3.1/tests/test_typing.py
--- old/immutabledict-4.2.2/tests/test_typing.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/immutabledict-4.3.1/tests/test_typing.py        1970-01-01 
01:00:00.000000000 +0100
@@ -0,0 +1,129 @@
+# pyright: reportUnnecessaryTypeIgnoreComment=true
+"""Typing tests for immutabledict, validated via `make style`.
+
+These are not real unit tests, but rather a way to ensure
+that the type annotations are correct.
+
+``reportUnnecessaryTypeIgnoreComment=true`` (above) ensures that
+``# type: ignore`` comments stay necessary, i.e. the suppressed
+errors are genuinely produced.
+"""
+
+from typing import Any, ItemsView, KeysView, Union, ValuesView
+
+from immutabledict import ImmutableOrderedDict, immutabledict
+
+
+class TestImmutableDictTyping:
+    def test_construct_empty(self) -> None:
+        _d: immutabledict[str, int] = immutabledict()
+
+    def test_construct_kwargs(self) -> None:
+        _d: immutabledict[str, int] = immutabledict(a=1, b=2)
+
+    def test_construct_mapping(self) -> None:
+        _d: immutabledict[str, int] = immutabledict({"a": 1})
+
+    def test_construct_mapping_and_kwargs(self) -> None:
+        _d: immutabledict[str, int] = immutabledict({"a": 1}, b=2)
+
+    def test_construct_iterable(self) -> None:
+        _d: immutabledict[str, int] = immutabledict([("a", 1)])
+
+    def test_construct_iterable_and_kwargs(self) -> None:
+        _d: immutabledict[str, int] = immutabledict([("a", 1)], b=2)
+
+    def test_construct_heterogeneous_kwargs(self) -> None:
+        # Any because **kwargs uses Any for pytype/pyrefly compat
+        _d: immutabledict[str, Any] = immutabledict(a=1, b="hello")
+
+    def test_construct_heterogeneous_kwargs_three_types(self) -> None:
+        # Any because **kwargs uses Any for pytype/pyrefly compat
+        _d: immutabledict[str, Any] = immutabledict(a=1, b="hello", c=True)
+
+    def test_construct_heterogeneous_mapping(self) -> None:
+        _d: immutabledict[str, Union[int, str]] = immutabledict({"a": 1, "b": 
"hello"})
+
+    def test_construct_heterogeneous_iterable(self) -> None:
+        _d: immutabledict[str, Union[int, str]] = immutabledict(
+            [("a", 1), ("b", "hello")]
+        )
+
+    def test_construct_heterogeneous_keys_mapping(self) -> None:
+        _d: immutabledict[Union[int, str], str] = immutabledict({1: "a", "b": 
"c"})
+
+    def test_construct_heterogeneous_mapping_and_kwargs(self) -> None:
+        _d: immutabledict[str, Union[int, str]] = immutabledict(
+            {"a": 1, "b": "hello"}, c=2
+        )
+
+    def test_construct_heterogeneous_iterable_and_kwargs(self) -> None:
+        _d: immutabledict[str, Union[int, str]] = immutabledict(
+            [("a", 1), ("b", "hello")], c=2
+        )
+
+    def test_construct_wrong_heterogeneous_mapping(self) -> None:
+        _d: immutabledict[str, int] = immutabledict({"a": 1, "b": "oops"})  # 
type: ignore[arg-type, dict-item]
+
+    def test_construct_wrong_value_mapping(self) -> None:
+        _d: immutabledict[str, int] = immutabledict({"a": "oops"})  # type: 
ignore[arg-type, dict-item]
+
+    def test_construct_wrong_value_iterable(self) -> None:
+        _d: immutabledict[str, int] = immutabledict([("a", "oops")])  # type: 
ignore[arg-type, list-item]
+
+    def test_fromkeys(self) -> None:
+        _d: immutabledict[str, int] = immutabledict.fromkeys(["a", "b"], 0)
+
+    def test_getitem_returns_value_type(self) -> None:
+        d: immutabledict[str, int] = immutabledict(a=1)
+        _v: int = d["a"]
+
+    def test_view_types(self) -> None:
+        d: immutabledict[str, int] = immutabledict(a=1, b=2)
+        _k: KeysView[str] = d.keys()
+        _vals: ValuesView[int] = d.values()
+        _itms: ItemsView[str, int] = d.items()
+
+    def test_iteration_yields_key_type(self) -> None:
+        d: immutabledict[str, int] = immutabledict(a=1)
+        for key in d:
+            _k: str = key
+
+    def test_mutation_methods_return_immutabledict(self) -> None:
+        d: immutabledict[str, int] = immutabledict(a=1, b=2)
+        _d_set: immutabledict[str, int] = d.set("c", 3)
+        _d_del: immutabledict[str, int] = d.delete("a")
+        _d_upd: immutabledict[str, int] = d.update({"c": 3})
+        _d_disc: immutabledict[str, int] = d.discard("a")
+        _d_copy: immutabledict[str, int] = d.copy()
+
+    def test_or_returns_immutabledict(self) -> None:
+        d: immutabledict[str, int] = immutabledict(a=1, b=2)
+        _d_or: immutabledict[str, int] = d | {"c": 3}
+
+
+class TestImmutableOrderedDictTyping:
+    def test_construct_empty(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict()
+
+    def test_construct_mapping(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict({"a": 1})
+
+    def test_construct_kwargs(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict(a=1, b=2)
+
+    def test_construct_iterable(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict([("a", 1)])
+
+    def test_construct_mapping_and_kwargs(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict({"a": 1}, 
b=2)
+
+    def test_construct_iterable_and_kwargs(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict([("a", 1)], 
b=2)
+
+    def test_construct_heterogeneous_kwargs(self) -> None:
+        # Any because **kwargs uses Any for pytype/pyrefly compat
+        _d: ImmutableOrderedDict[str, Any] = ImmutableOrderedDict(a=1, 
b="hello")
+
+    def test_construct_wrong_value_mapping(self) -> None:
+        _d: ImmutableOrderedDict[str, int] = ImmutableOrderedDict({"a": 
"oops"})  # type: ignore[arg-type, dict-item]

Reply via email to