Skip to content

Commit

Permalink
Make classproperty.__get__() return Any
Browse files Browse the repository at this point in the history
As for now, the getter's return type can't be determined. It's better to leave the return type as `Any` so that one could narrow down the getter's return type to their needs.
  • Loading branch information
bswck committed Nov 14, 2023
1 parent 5b84b54 commit 304e455
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jaraco/classes/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

if TYPE_CHECKING:
from collections.abc import Callable
from typing import Any

from typing_extensions import NoReturn, Self, TypeAlias

Expand Down Expand Up @@ -192,7 +193,7 @@ def __init__(
self.fset = fset # type: ignore[assignment] # Corrected in the next line.
fset and self.setter(fset)

def __get__(self, instance: object, owner: type[object] | None = None) -> object:
def __get__(self, instance: object, owner: type[object] | None = None) -> Any:
return self.fget.__get__(None, owner)()

def __set__(self, owner: type[object], value: object) -> None:
Expand Down

0 comments on commit 304e455

Please sign in to comment.