]>
crepu.dev Git - config.git/blob - djavu-asus/elpy/rpc-venv/lib/python3.11/site-packages/jedi/api/completion_cache.py
1 from typing
import Dict
, Tuple
, Callable
3 CacheValues
= Tuple
[str, str, str]
4 CacheValuesCallback
= Callable
[[], CacheValues
]
7 _cache
: Dict
[str, Dict
[str, CacheValues
]] = {}
10 def save_entry(module_name
: str, name
: str, cache
: CacheValues
) -> None:
12 module_cache
= _cache
[module_name
]
14 module_cache
= _cache
[module_name
] = {}
15 module_cache
[name
] = cache
18 def _create_get_from_cache(number
: int) -> Callable
[[str, str, CacheValuesCallback
], str]:
19 def _get_from_cache(module_name
: str, name
: str, get_cache_values
: CacheValuesCallback
) -> str:
21 return _cache
[module_name
][name
][number
]
23 v
= get_cache_values()
24 save_entry(module_name
, name
, v
)
26 return _get_from_cache
29 get_type
= _create_get_from_cache(0)
30 get_docstring_signature
= _create_get_from_cache(1)
31 get_docstring
= _create_get_from_cache(2)