diff --git a/src/sage/misc/lazy_attribute.pyi b/src/sage/misc/lazy_attribute.pyi new file mode 100644 index 00000000000..6a174a37aa2 --- /dev/null +++ b/src/sage/misc/lazy_attribute.pyi @@ -0,0 +1,9 @@ +# This type-stub file helps pyright understand the decorator @lazy_attribute. + +# Adapted from https://github.com/python/typeshed/blob/b9640005eb586afdbe0a57bac2b88a7a12465069/stdlib/builtins.pyi#L1237-L1254 +class lazy_attribute: + def __init__( + self, + f: Callable[[Any], Any] | None = ... + ) -> None: ... + def __get__(self, a: Any, cls: type) -> Any: ...