Commit Graph

4 Commits

Author SHA256 Message Date
dadf1232c4 Convert to libalternatives, bsc#1245883 2025-11-03 14:54:59 +01:00
6917d24177 add missing runtime dependency
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=35
2025-05-30 11:16:46 +00:00
ad2c1ad96e Add missing BR
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=34
2025-05-29 15:34:38 +00:00
79e4785261 - Remove upstreamed mypy-1.14.1-gcc15.patch
- Update to 1.16.0:
    Different Property Getter and Setter Types
    Mypy now supports using different types for a property getter and setter:
    class A:
        _value: int
        @property
        def foo(self) -> int:
            return self._value
        @foo.setter
        def foo(self, x: str | int) -> None:
            try:
                self._value = int(x)
            except ValueError:
                raise Exception(f"'{x}' is not a valid value for 'foo'")
    This was contributed by Ivan Levkivskyi (PR 18510).
    Flexible Variable Redefinitions (Experimental)
    Mypy now allows unannotated variables to be freely redefined
    with different types when using the experimental
    --allow-redefinition-new flag. You will also need to enable
    --local-partial-types. Mypy will now infer a union type when
    different types are assigned to a variable:
    # mypy: allow-redefinition-new, local-partial-types
    def f(n: int, b: bool) -> int | str:
        if b:
            x = n
        else:
            x = str(n)
        # Type of 'x' is int | str here.
        return x

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mypy?expand=0&rev=33
2025-05-29 15:32:58 +00:00