Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/propcache/_helpers_py.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Various helper functions."""

from __future__ import annotations

import sys
from collections.abc import Mapping
from collections.abc import Callable, Mapping
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")

Expand Down Expand Up @@ -39,16 +41,16 @@
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: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

@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:
Expand Down
Loading