Skip to content

Commit

Permalink
Fix type hint for lazy property
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Aug 19, 2024
1 parent a6e3af8 commit b1e256a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions griptape/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def wrapper(self: Any, *args, **kwargs) -> Any:
return decorator


def lazy_property(attr_name: Optional[str] = None) -> Any:
def decorator(func: Callable) -> Any:
actual_attr_name = f"_{func.__name__}" if attr_name is None else attr_name
def lazy_property(attr_name: Optional[str] = None) -> Callable[[Callable[[Any], Any]], property]:
def decorator(func: Callable[[Any], Any]) -> property:
actual_attr_name = attr_name if attr_name is not None else f"_{func.__name__}"

@property
@functools.wraps(func)
Expand Down

0 comments on commit b1e256a

Please sign in to comment.