diff --git a/src/sage/misc/cachefunc.pyi b/src/sage/misc/cachefunc.pyi index 0fb068892f5..a4e8f681882 100644 --- a/src/sage/misc/cachefunc.pyi +++ b/src/sage/misc/cachefunc.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Dict, Tuple, Union +from typing import Any, Callable, Dict, Tuple def dict_key(o: Any) -> Any: ... @@ -7,7 +7,9 @@ def cache_key(o: Any) -> Any: ... class CachedFunction: - def __init__(self, f: Callable, classmethod: bool = False, name: str = None, key: Callable = None, do_pickle: bool = None) -> None: + def __init__(self, f: Callable, classmethod: bool = False, + name: str | None = None, key: Callable | None = None, + do_pickle: bool | None = None) -> None: ... def __call__(self, *args: Any, **kwds: Any) -> Any: @@ -35,7 +37,9 @@ class CachedFunction: ... class CachedMethod: - def __init__(self, f: Callable, name: str = None, key: Callable = None, do_pickle: bool = None) -> None: + def __init__(self, f: Callable, name: str | None = None, + key: Callable | None = None, + do_pickle: bool | None = None) -> None: ... def __call__(self, inst: Any, *args: Any, **kwds: Any) -> Any: @@ -51,7 +55,9 @@ class CacheDict(dict): pass class CachedInParentMethod(CachedMethod): - def __init__(self, f: Callable, name: str = None, key: Callable = None, do_pickle: bool = None) -> None: + def __init__(self, f: Callable, name: str | None = None, + key: Callable | None = None, + do_pickle: bool | None = None) -> None: ... def _get_instance_cache(self, inst: Any) -> Dict: @@ -61,7 +67,10 @@ class CachedInParentMethod(CachedMethod): ... class CachedMethodCaller(CachedFunction): - def __init__(self, cachedmethod: CachedMethod, inst: Any, cache: Dict = None, name: str = None, key: Callable = None, do_pickle: bool = None) -> None: + def __init__(self, cachedmethod: CachedMethod, inst: Any, + cache: Dict | None = None, name: str | None = None, + key: Callable | None = None, + do_pickle: bool | None = None) -> None: ... def _instance_call(self, *args: Any, **kwds: Any) -> Any: @@ -80,7 +89,9 @@ class CachedMethodCaller(CachedFunction): ... class CachedMethodCallerNoArgs(CachedFunction): - def __init__(self, inst: Any, f: Callable, cache: Any = None, name: str = None, do_pickle: bool = None) -> None: + def __init__(self, inst: Any, f: Callable, cache: Any = None, + name: str | None = None, + do_pickle: bool | None = None) -> None: ... def _instance_call(self) -> Any: