From 34083640dc59b4ad92ac132d80ded2383aa346c2 Mon Sep 17 00:00:00 2001 From: Vizonex Date: Thu, 22 Jan 2026 13:13:54 -0600 Subject: [PATCH 1/5] upgrade typehints to 3.10 --- src/propcache/_helpers_py.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/propcache/_helpers_py.py b/src/propcache/_helpers_py.py index 1374fc6d..7f38f77d 100644 --- a/src/propcache/_helpers_py.py +++ b/src/propcache/_helpers_py.py @@ -1,9 +1,9 @@ """Various helper functions.""" import sys -from collections.abc import Mapping +from collections.abc import Mapping, Callable from functools import cached_property -from typing import Any, Callable, Generic, Optional, Protocol, TypeVar, Union, overload +from typing import Any, Generic, Protocol, TypeVar, overload __all__ = ("under_cached_property", "cached_property") @@ -39,16 +39,16 @@ def __init__(self, wrapped: Callable[[Any], _T]) -> None: self.name = wrapped.__name__ @overload - def __get__(self, inst: None, owner: Optional[type[object]] = None) -> Self: ... + def __get__(self, inst: None, owner: type[object] | None = None) -> Self: ... @overload def __get__( - self, inst: _CacheImpl[Any], owner: Optional[type[object]] = None + self, inst: _CacheImpl[Any], owner: type[object] | None = None ) -> _T: ... def __get__( - self, inst: Optional[_CacheImpl[Any]], owner: Optional[type[object]] = None - ) -> Union[_T, Self]: + self, inst: _CacheImpl[Any] | None, owner: type[object] | None = None + ) -> _T | Self: if inst is None: return self try: From f698b2623ea1f3b2de829e7c596a1ec0187a7c58 Mon Sep 17 00:00:00 2001 From: Vizonex Date: Thu, 22 Jan 2026 13:16:04 -0600 Subject: [PATCH 2/5] allow 3.9 backwards compatability using __future__.annotations --- src/propcache/_helpers_py.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/propcache/_helpers_py.py b/src/propcache/_helpers_py.py index 7f38f77d..3cadc6a4 100644 --- a/src/propcache/_helpers_py.py +++ b/src/propcache/_helpers_py.py @@ -1,5 +1,6 @@ """Various helper functions.""" +from __future__ import annotations import sys from collections.abc import Mapping, Callable from functools import cached_property From 5c48fbe6905e69a244b74531eb11c0f498cce5ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 19:20:24 +0000 Subject: [PATCH 3/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/propcache/_helpers_py.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/propcache/_helpers_py.py b/src/propcache/_helpers_py.py index 3cadc6a4..db5b8d63 100644 --- a/src/propcache/_helpers_py.py +++ b/src/propcache/_helpers_py.py @@ -1,8 +1,9 @@ """Various helper functions.""" from __future__ import annotations + import sys -from collections.abc import Mapping, Callable +from collections.abc import Callable, Mapping from functools import cached_property from typing import Any, Generic, Protocol, TypeVar, overload From ca093bc1a747702cd38fc3bad43e9e019498d112 Mon Sep 17 00:00:00 2001 From: Vizonex Date: Thu, 22 Jan 2026 13:22:54 -0600 Subject: [PATCH 4/5] add 193 to timeline --- CHANGES/193.feature.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CHANGES/193.feature.rst diff --git a/CHANGES/193.feature.rst b/CHANGES/193.feature.rst new file mode 100644 index 00000000..8c9f637f --- /dev/null +++ b/CHANGES/193.feature.rst @@ -0,0 +1,2 @@ +Added support for newer type hints and remove ``Optional`` and ``Union`` from all annotations +-- by :user:`Vizonex` \ No newline at end of file From ad3e1074b3d29837f37f4d45982e4795ae4c642f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 19:23:41 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CHANGES/193.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES/193.feature.rst b/CHANGES/193.feature.rst index 8c9f637f..0f88d697 100644 --- a/CHANGES/193.feature.rst +++ b/CHANGES/193.feature.rst @@ -1,2 +1,2 @@ Added support for newer type hints and remove ``Optional`` and ``Union`` from all annotations --- by :user:`Vizonex` \ No newline at end of file +-- by :user:`Vizonex`