| 1 |
from collections.abc import Callable |
| 2 |
from typing import Any |
| 3 |
from typing_extensions import TypeAlias |
| 4 |
|
| 5 |
__all__ = ["getline", "clearcache", "checkcache", "lazycache"] |
| 6 |
|
| 7 |
_ModuleGlobals: TypeAlias = dict[str, Any] |
| 8 |
_ModuleMetadata: TypeAlias = tuple[int, float | None, list[str], str] |
| 9 |
|
| 10 |
_SourceLoader: TypeAlias = tuple[Callable[[], str | None]] |
| 11 |
|
| 12 |
cache: dict[str, _SourceLoader | _ModuleMetadata] |
| 13 |
|
| 14 |
def getline(filename: str, lineno: int, module_globals: _ModuleGlobals | None = None) -> str: ... |
| 15 |
def clearcache() -> None: ... |
| 16 |
def getlines(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... |
| 17 |
def checkcache(filename: str | None = None) -> None: ... |
| 18 |
def updatecache(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... |
| 19 |
def lazycache(filename: str, module_globals: _ModuleGlobals) -> bool: ... |