1- from typing import Any , Callable , Dict , Tuple , Union
1+ from typing import Any , Callable , Dict , Tuple
22
33def dict_key (o : Any ) -> Any :
44 ...
@@ -7,7 +7,9 @@ def cache_key(o: Any) -> Any:
77 ...
88
99class CachedFunction :
10- def __init__ (self , f : Callable , classmethod : bool = False , name : str = None , key : Callable = None , do_pickle : bool = None ) -> None :
10+ def __init__ (self , f : Callable , classmethod : bool = False ,
11+ name : str | None = None , key : Callable | None = None ,
12+ do_pickle : bool | None = None ) -> None :
1113 ...
1214
1315 def __call__ (self , * args : Any , ** kwds : Any ) -> Any :
@@ -35,7 +37,9 @@ class CachedFunction:
3537 ...
3638
3739class CachedMethod :
38- def __init__ (self , f : Callable , name : str = None , key : Callable = None , do_pickle : bool = None ) -> None :
40+ def __init__ (self , f : Callable , name : str | None = None ,
41+ key : Callable | None = None ,
42+ do_pickle : bool | None = None ) -> None :
3943 ...
4044
4145 def __call__ (self , inst : Any , * args : Any , ** kwds : Any ) -> Any :
@@ -51,7 +55,9 @@ class CacheDict(dict):
5155 pass
5256
5357class CachedInParentMethod (CachedMethod ):
54- def __init__ (self , f : Callable , name : str = None , key : Callable = None , do_pickle : bool = None ) -> None :
58+ def __init__ (self , f : Callable , name : str | None = None ,
59+ key : Callable | None = None ,
60+ do_pickle : bool | None = None ) -> None :
5561 ...
5662
5763 def _get_instance_cache (self , inst : Any ) -> Dict :
@@ -61,7 +67,10 @@ class CachedInParentMethod(CachedMethod):
6167 ...
6268
6369class CachedMethodCaller (CachedFunction ):
64- def __init__ (self , cachedmethod : CachedMethod , inst : Any , cache : Dict = None , name : str = None , key : Callable = None , do_pickle : bool = None ) -> None :
70+ def __init__ (self , cachedmethod : CachedMethod , inst : Any ,
71+ cache : Dict | None = None , name : str | None = None ,
72+ key : Callable | None = None ,
73+ do_pickle : bool | None = None ) -> None :
6574 ...
6675
6776 def _instance_call (self , * args : Any , ** kwds : Any ) -> Any :
@@ -80,7 +89,9 @@ class CachedMethodCaller(CachedFunction):
8089 ...
8190
8291class CachedMethodCallerNoArgs (CachedFunction ):
83- def __init__ (self , inst : Any , f : Callable , cache : Any = None , name : str = None , do_pickle : bool = None ) -> None :
92+ def __init__ (self , inst : Any , f : Callable , cache : Any = None ,
93+ name : str | None = None ,
94+ do_pickle : bool | None = None ) -> None :
8495 ...
8596
8697 def _instance_call (self ) -> Any :
0 commit comments