Skip to content

Commit 05e34ef

Browse files
author
Matthias Koeppe
committed
src/sage/misc/lazy_attribute.pyi: Proper type stub for lazy_attribute
1 parent 8852022 commit 05e34ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sage/misc/lazy_attribute.pyi

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# This type-stub file helps pyright understand the decorator @lazy_attribute.
22

3-
lazy_attribute = property
3+
# Adapted from https://github.com/python/typeshed/blob/b9640005eb586afdbe0a57bac2b88a7a12465069/stdlib/builtins.pyi#L1237-L1254
4+
class lazy_attribute:
5+
def __init__(
6+
self,
7+
f: Callable[[Any], Any] | None = ...
8+
) -> None: ...
9+
def __get__(self, a: Any, cls: type) -> Any: ...

0 commit comments

Comments
 (0)