Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/sage/misc/cachefunc.pyi
Original file line number Diff line number Diff line change
@@ -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:
...
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
Loading